Reinstalling WordPress can help resolve issues caused by corrupted files, malware infections, or broken updates. In this guide, we’ll cover three methods to reinstall WordPress: via WP-Admin, via SSH with WP-CLI, and via SFTP. Before proceeding, always back up your website to avoid data loss.
1. Reinstall WordPress via WP-Admin
If you still have access to your WordPress dashboard, this is the easiest way to reinstall WordPress without needing technical knowledge.
Step 1: Log in to Your WordPress Dashboard
Go to yourdomain.com/wp-admin
and enter your credentials.
Step 2: Reinstall WordPress Core
- Navigate to Dashboard > Updates.
- Click the Re-install Now button.
- WordPress will automatically download and reinstall the latest core files without affecting your themes, plugins, or media files.
Step 3: Verify Your Site
Once the process is complete, visit your website to ensure it’s functioning correctly. Check if all plugins and themes are active and working as expected.
2. Reinstall WordPress via SSH and WP-CLI
If you have SSH access, WP-CLI provides a quick and efficient way to reinstall WordPress.
Step 1: Log in to SSH
- Open a terminal (Linux/macOS) or use an SSH client like PuTTY (Windows).
- Run the following command:
ssh username@yourserver.com
Replaceusername
with your SSH username andyourserver.com
with your domain or server IP.
Step 2: Navigate to Your WordPress Directory
Once logged in, move to your WordPress installation folder:
cd /var/www/html/ # Adjust this path based on your setup
Step 3: Reinstall WordPress Core
Download and replace WordPress core files without affecting your content:
wp core download --skip-content --force
This ensures a fresh installation while keeping your themes, plugins, and uploads intact.
Step 4: Verify the Installation
After reinstalling, visit your website and log in to confirm everything is working as expected. Also, check your database connection and ensure all functionalities are intact.
3. Reinstall WordPress via SFTP
If you don’t have SSH access, you can manually reinstall WordPress using SFTP (Secure File Transfer Protocol).
Step 1: Log in to Your Server via SFTP
- Install an SFTP client like FileZilla or Cyberduck.
- Open the client and enter your credentials:
- Host: yourdomain.com
- Username: Your FTP username
- Password: Your FTP password
- Port: 22 (for SFTP)
- Click Quickconnect to establish the connection.
Step 2: Download WordPress Core Files
- Visit the official WordPress download page.
- Download and extract the latest version of WordPress on your computer.
Step 3: Remove Old WordPress Files
- In FileZilla, navigate to your WordPress installation folder (e.g.,
public_html
). - Delete the following folders:
wp-admin
wp-includes
- Do not delete
wp-content
, as it contains your themes, plugins, and media files.
Step 4: Upload Fresh WordPress Files
- Upload the extracted
wp-admin
andwp-includes
folders. - Also upload all core WordPress files (excluding
wp-content
).
Step 5: Verify Your Site
Once the upload is complete, visit your website to confirm that everything is working correctly. Clear your cache if needed and ensure that all functionality is restored.
Conclusion
Reinstalling WordPress is straightforward whether you use WP-Admin, SSH, or SFTP. The WP-Admin method is the easiest, but for more control, SSH with WP-CLI or SFTP are great options. Always back up your website before making changes to prevent data loss.
If you found this guide helpful, let us know in the comments below!