A robust, standalone PHP script designed to safely update or reinstall WordPress core files directly from your server. Featuring a modern, responsive UI and advanced safety mechanisms, this tool is perfect for fixing corrupted WordPress installations, resolving malware infections, or forcing an update without relying on the WordPress dashboard.
- 🛡️ Ultra-Safe Core Replacement: Unlike older scripts that wipe the entire root directory, this script only deletes
wp-adminandwp-includes. It leaveswp-content,wp-config.php, and any custom folders (like subdomains, Laravel apps, or Google verification files) completely untouched. - 🎨 Modern UI/UX: Features a clean, Tailwind-inspired design with sleek typography, SVG icons, and a beautiful loading overlay. No more looking at ugly, raw HTML logs!
- 🌍 Bilingual Support: Easily switch between English and Indonesian (
?lang=enor?lang=id). - 🔒 Built-in Security Checks: Scans your core files for dangerous
0777permissions and warns you immediately. Also includes CSRF token protection to prevent malicious automated executions. - ⚡ Resilient on Shared Hosting: Configured with a 10-minute timeout limit and SSL verification bypass to ensure downloads and extractions succeed even on low-end servers or servers with expired CA certificates.
- 📋 Real-time Execution Logs: Displays a neat, terminal-like log dashboard upon completion so you know exactly what happened behind the scenes.
Before running this script, ensure your server meets the following requirements:
- PHP: Version 7.2 or higher (PHP 8.x fully supported).
- Extensions Enabled:
cURL,ZipArchive, andsession. - Permissions: The web server must have write permissions to the WordPress root directory.
⚠️ EXTREMELY IMPORTANT: Always perform a full backup of your files and database before running this script.
- Download the Script: Save the provided PHP code into a file named
reinstall-wp-core.php. - Upload to Server: Upload
reinstall-wp-core.phpinto your WordPress root directory (the same folder where yourwp-config.phpis located). - Run the Script: Open your web browser and navigate to the script URL:
https://yourdomain.com/reinstall-wp-core.php - Follow the UI:
- The script will automatically detect your current WordPress version and the latest available version.
- If there are
0777permission warnings, take note of them. - Click Start Update Process (or Reinstall Core if forcing an update).
- Wait for Completion: Do not close the tab while the loading overlay is active. The script will download, extract, and replace the core files.
- 🧹 Clean Up (Crucial Step): Once the process is successfully completed, DELETE the
reinstall-wp-core.phpfile from your server to prevent unauthorized access.
When you click the update button, the script performs the following steps sequentially:
- Validates the CSRF token to ensure the request is legitimate.
- Downloads the latest official
latest.zipdirectly fromhttps://wordpress.org. - Extracts the ZIP file into a temporary secure folder.
- Safely deletes the old
wp-adminandwp-includesdirectories. - Copies the new core files into your root directory, strictly bypassing the
wp-contentfolder to ensure your themes, plugins, and uploads remain perfectly intact. - Cleans up all temporary ZIP files and extraction folders.
This tool is provided "as is" without any warranties. While it has been specifically engineered to prevent accidental data loss, server environments vary greatly. The author is not responsible for any data loss, server downtime, or damage caused by the use of this script. Always back up your site.
Designed with ❤️ for System Administrators, Web Developers, and WordPress Enthusiasts.