Post Date: September 21, 2018
Last Updated: September 28, 2026
Introduction
WordPress is one of the most widely used content management systems (CMS) for building websites and blogs. Keeping your WordPress installation up to date is essential for maintaining security, improving performance, fixing bugs, and ensuring compatibility with the latest themes and plugins.
Although WordPress provides an automatic update feature, there may be situations where a manual upgrade is required. For example, automatic updates may fail due to file permission issues, server restrictions, or customized hosting environments. In such cases, manually upgrading WordPress ensures that your website remains secure and up to date.
In this tutorial, we will learn how to manually upgrade WordPress on a CentOS 7 server running a LAMP stack. We will demonstrate the process of upgrading WordPress from version 4.8.7 to 4.8.9 while preserving your website content, themes, plugins, and database.
Prerequisites
Before proceeding, ensure that you have the following:
- Basic knowledge of WordPress and MySQL
- Root or sudo access to the server
- A working LAMP stack installed on CentOS 7
- A complete backup of your WordPress files and database
Assumptions
For this tutorial, we assume the following:
- CentOS 7 is installed and running on your server.
- Current WordPress version: 4.8.7
- Target WordPress version: 4.8.9
- WordPress installation path:
/var/www/html/wordpress
Note: You can replace the paths used in this guide with the paths applicable to your environment.
Create a Backup Before Upgrading
Before upgrading WordPress, create a complete backup of your website files and MySQL database. This backup allows you to restore the website quickly if anything goes wrong during the upgrade process.
Backup Website Files
cd /var/www/html tar -czvf wordpress-backup.tar.gz wordpress
Backup WordPress Database
mysqldump -u root -p wordpress_db > wordpress_db_backup.sql
Replace wordpress_db with your actual WordPress database name.
Implementation
Upgrading WordPress Core Manually
Step 1: Download the Latest WordPress Release
Download the latest WordPress package from the official WordPress website:
You can also download it directly using wget:
wget https://wordpress.org/latest.tar.gz
Step 2: Extract the Downloaded Package
Extract the downloaded WordPress archive:
tar -xzf latest.tar.gz
This will create a directory named wordpress.
For this example, the extracted files are located in:
/root/wordpress
Step 3: Remove Existing Core Directories
Navigate to your WordPress installation directory and remove the old core directories.
cd /var/www/html/wordpress rm -rf wp-admin wp-includes
These directories contain WordPress core files and will be replaced with the updated versions.
Step 4: Copy New Core Directories
Copy the new wp-admin and wp-includes directories from the extracted package to the existing WordPress installation.
mv /root/wordpress/wp-admin /var/www/html/wordpress/ mv /root/wordpress/wp-includes /var/www/html/wordpress/
Verify that both directories have been copied successfully.
Step 5: Replace Remaining Core Files
Copy all remaining files from the extracted WordPress package to your existing installation directory.
cp -rf /root/wordpress/* /var/www/html/wordpress/
This process overwrites existing WordPress core files with updated versions while preserving your content.
Important: Do not delete the
wp-contentdirectory because it contains your themes, plugins, and uploaded media files.
Step 6: Review Configuration Changes
Your existing wp-config.php file will remain intact because WordPress only includes a sample configuration file named:
wp-config-sample.php
Compare the new sample configuration file with your existing configuration to determine whether any new settings need to be added.
Step 7: Run the WordPress Upgrade Script
Open your web browser and visit:
http://your-domain.com/wp-admin/
or
http://your-server-ip/wp-admin/
If a database update is required, WordPress will automatically prompt you to update the database.
Click Update WordPress Database and wait for the process to complete.
Step 8: Verify Website Functionality
After the upgrade completes:
- Log in to the WordPress admin dashboard.
- Check website pages and posts.
- Verify that themes are loading correctly.
- Confirm that plugins are functioning as expected.
- Review the WordPress version from Dashboard → Updates.
Step 9: Clear Browser and Website Cache
Clear your browser cache and any caching plugins to ensure that the latest files are served to visitors.
If you are using a CDN such as Cloudflare, clear the CDN cache as well.
Post-Upgrade Checklist
After successfully upgrading WordPress, perform the following checks:
- Verify website accessibility.
- Check plugin compatibility.
- Test contact forms and login functionality.
- Review Apache and PHP logs for errors.
- Confirm that SSL certificates are working correctly.
- Ensure media files and uploads are accessible.
Troubleshooting Common Issues
White Screen After Upgrade
Check PHP errors:
tail -f /var/log/httpd/error_log
Increase PHP memory limit if required.
Plugin Compatibility Issues
Disable all plugins and enable them one by one to identify incompatible plugins.
Permission Errors
Set appropriate ownership and permissions:
chown -R apache:apache /var/www/html/wordpress
find /var/www/html/wordpress -type d -exec chmod 755 {} \;
find /var/www/html/wordpress -type f -exec chmod 644 {} \;
Unable to Access Admin Dashboard
Clear browser cookies and cache, then try logging in again.
Conclusion
Manually upgrading WordPress on CentOS 7 is a reliable method when automatic updates are unavailable or fail due to server-related issues. By carefully replacing the WordPress core files while preserving the wp-content directory and existing configuration, you can safely upgrade your website without affecting content, themes, or plugins.
Always create a complete backup before performing any upgrade and thoroughly test your website afterward. Regular updates help improve security, enhance performance, and ensure compatibility with the latest WordPress ecosystem.
Frequently Asked Questions (FAQ)
1. Why should I upgrade WordPress regularly?
Regular WordPress updates include security patches, bug fixes, performance improvements, and compatibility enhancements for themes and plugins. Keeping WordPress updated helps protect your website from vulnerabilities.
2. Will a manual WordPress upgrade delete my posts, pages, or media files?
No. A manual upgrade does not affect your website content if you preserve the wp-content directory and wp-config.php file. However, creating a backup before upgrading is strongly recommended.
3. What should I do if the upgrade fails?
If the upgrade fails, restore your website using the backup files and database backup created before the upgrade. Check Apache, PHP, and WordPress logs to identify the root cause before attempting the upgrade again.
Related Articles
- How to check IP address in CentOS 7 minimal Server -Ifconfig not working
- Step-by-Step Guide to Install CentOS 7 on VMware Fusion for macOS
- Install Fail2ban on Centos 7
Talk to our experts
Looking for the right technology solution for your business?. Our experts can help with web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team here.