WordPress Basics

How to Update PHP in WordPress

Advanced WordPress development patterns

If your WordPress site feels slow, throws strange errors, or your hosting dashboard is nagging you about “outdated PHP”, it is time to upgrade. PHP is the programming language that runs WordPress, and newer versions are faster, more secure, and better supported by modern plugins and themes.

This step-by-step tutorial shows you how to update PHP in WordPress without breaking your site. Along the way, you will check your current version, test compatibility, create a full backup, upgrade via your hosting panel, and learn what to do if something goes wrong.

What You Need Before Updating PHP

  • Login details for your hosting control panel (cPanel, Plesk, or custom dashboard).
  • Login to your WordPress admin (yourdomain.com/wp-admin).
  • Basic familiarity with installing and updating plugins.
  • A few minutes when your site gets lower traffic, in case you need to troubleshoot.
Never change your PHP version on a busy production site without a recent backup and a recovery plan.

Step 1: Check Your Current PHP and WordPress Versions

Start by seeing what you are working with so you know how big the jump will be.

  1. Log in to your WordPress Dashboard.
  2. Go to Tools » Site Health and click the Info tab.
  3. Scroll down to Server to see your current PHP version.
WordPress Site Health server details showing PHP version 8.1.33, LiteSpeed web server, and PHP limits, crucial for updating PHP in WordPress.
The WordPress Site Health tool provides essential details about your PHP version and server environment.

Write a quick note like: “WordPress 6.x running on PHP 7.4” so you can refer back to it later.

Step 2: Make a Full Backup (Files + Database)

Updating PHP is usually safe, but a broken plugin or theme can result in a white screen or fatal error. A complete backup lets you restore your site quickly if anything goes wrong.

  1. Choose a backup method:
    • A reliable backup plugin (for example, a dedicated WordPress backup plugin).
    • Or, hosting-level backup in your control panel (often called Backup, Snapshots, or Restore Points).
  2. Run a full backup that includes:
    • All WordPress files (wp-content, plugins, themes, uploads).
    • The entire WordPress database.
  3. Either download the backup or confirm that your host keeps it for at least a few days.
cPanel Backup Wizard for WordPress hosting backups, showing options to download a full site backup or restore parts.
The cPanel Backup Wizard helps users manage WordPress hosting backups, offering both backup and restore options.
If your host offers one-click restore points, create one just before changing PHP; that can be the fastest way to roll back if needed.

Step 3: Update WordPress, Themes, and Plugins First

Newer PHP versions expect your site’s code to be reasonably up to date. Old plugins are a common cause of problems after upgrading.

  1. In your dashboard, go to Dashboard » Updates.
  2. Update WordPress core if a new version is available.
  3. Bring all installed plugins up to date so they match modern PHP requirements.
  4. Remove any plugins or themes you no longer use, because inactive but outdated code can still cause conflicts.
WordPress dashboard updates screen showing current version 6.9, confirming core, plugins, and themes are up to date.
The WordPress Updates screen shows the current version 6.9 and confirms all plugins and themes are up to date.
If a plugin has not been updated in years and you rely on it heavily, check its support forum or look for a maintained alternative before changing PHP.

Step 4: Test PHP Compatibility (Optional but Recommended)

You can lower the risk further by scanning your site for PHP compatibility problems.

  1. Install a PHP compatibility checking plugin from Plugins » Add New (search for “PHP compatibility”).
  2. Run a scan for your current theme and all active plugins.
  3. Review the results:
    • Passed: Safe to use with newer PHP versions.
    • Warnings: Check plugin/theme docs or support before upgrading.
    • Errors: Strongly consider replacing that plugin/theme.
When your host includes a staging site, clone your site there and update PHP on staging first, fix any issues in that safe copy, then repeat on the live site once you are confident.

Step 5: Choose How You Will Update PHP

Most WordPress site owners do not change PHP inside WordPress itself. Instead, the change happens in your hosting account, where you can switch server versions.

Common Ways to Change PHP Version for WordPress

Method Where You Use It When to Use It
cPanel MultiPHP / Select PHP Version Hosting cPanel » MultiPHP Manager or Select PHP Version Most shared hosting accounts. Easy drop-down to change PHP per domain.
Managed WordPress Dashboard Host’s custom panel » site settings » PHP version Popular managed hosts that give a simple toggle for recommended PHP versions.
Plesk PHP Settings Plesk » Domains » your domain » PHP Settings VPS or some shared hosting using Plesk; more detailed control per subscription.
CLI / SSH (advanced) Server shell (SSH) » update PHP packages + web server config Developers and sysadmins managing VPS/dedicated servers who need full control.
Ask Your Host’s Support Support ticket or live chat Useful when you are unsure which version to choose or do not see the option in your panel.

Step 6: Update PHP via Your Hosting Panel

The exact screens vary, but the process is similar across most hosts. You can follow this generic flow and adapt it to your provider.

Method A: cPanel (MultiPHP Manager / Select PHP Version)

  1. Log in to your hosting cPanel.
  2. Look for MultiPHP Manager or Select PHP Version.
  3. Select your domain that runs WordPress.
  4. Choose a newer PHP version from the drop-down (stick to a stable version your host marks as “recommended”).
  5. Click Apply or Save.

Method B: Managed WordPress Hosting Dashboard

  1. Sign in to your hosting account dashboard.
  2. Open your site’s Manage or Settings page.
  3. Locate an option such as PHP Version, Runtime, or Environment.
  4. Select the recommended newer version and confirm the change.

Method C: Ask Support to Do It

  1. Open a support ticket or start a live chat with your host.
  2. Explain that you want to update PHP for your domain and that you have a recent backup.
  3. Ask them to move you to the latest stable PHP version supported by your hosting plan.
Avoid jumping from very old PHP directly to the newest version on a mission-critical site. When you are on something like PHP 7.0, consider stepping up in smaller increments and testing after each jump.

Step 7: Test Your WordPress Site After the Update

Once your host switches PHP, your site might still load perfectly—or reveal problems that were hidden before. Take a few minutes to test everything important.

  1. Open your site’s homepage in an incognito/private window.
  2. Click through key pages: blog, shop, contact form, login, and any custom templates.
  3. Log in to wp-admin and navigate to:
    • Posts » Add New
    • Pages » Add New
    • Any critical plugin screens (forms, ecommerce, bookings).
  4. Return to Tools » Site Health and confirm the new PHP version under Server.
WordPress Site Health screen indicating an outdated PHP version (8.1.33) and recommending an update for improved performance and security.
The WordPress Site Health tool helps identify if your site is running an older PHP version that requires an update.
If everything works normally and Site Health shows the new PHP version, your update is complete. Keep your backup for a few days just in case.

Step 8: What to Do If Updating PHP Breaks Your Site

If you see a white screen, fatal error, or critical error email after updating PHP, do not panic. Work through this checklist instead of making random changes.

1. Roll Back PHP Version (Quick Fix)

  • Return to your hosting panel and change PHP back to the previous version you noted earlier.
  • Save and reload your site so you can confirm it comes back online; when that happens, you are dealing with a compatibility issue, not a total disaster.

2. Identify the Problem Plugin or Theme

  1. In WordPress, deactivate all plugins temporarily.
  2. Switch to a default theme like Twenty Twenty-Four.
  3. Update PHP again to the newer version.
  4. Reactivate plugins one by one, testing the site after each activation.
  5. As soon as the error returns, you have found the plugin or theme causing issues.

3. Use Error Logs

  • Check your hosting control panel for Error Logs or a general Logs menu.
  • Scan the log for lines mentioning PHP Fatal error, a plugin folder, or a theme folder.
  • Share the relevant error message with your developer or the plugin/theme support team so they can pinpoint the issue.

4. Restore from Backup (Last Resort)

  • If the site is badly broken and you cannot fix it quickly, restore your backup.
  • After everything is back online, clone the site to staging and debug PHP issues there without pressure.
If a plugin or theme will not be fixed by its author, plan to replace it. Running on outdated PHP permanently is far riskier than switching to a modern alternative.

Step 9: Build PHP Updates into Your Maintenance Routine

PHP updates are not a “one-time” job. New versions arrive regularly and old ones reach end-of-life, which means no more security patches.

  1. Set a recurring reminder every 3–6 months to:
    • Check your PHP version in Site Health.
    • Review your host’s recommended version in their documentation.
    • Update WordPress core, plugins, themes, and renew backups.
  2. When you see notices in Site Health about outdated PHP, schedule a small maintenance window to upgrade.
  3. Maintain a short maintenance checklist that includes backups, update order, and testing steps.

Conclusion: Updating PHP in WordPress the Safe Way

Updating PHP in WordPress does not have to be scary. By checking your current versions, backing up your site, updating plugins and themes, testing compatibility, and using your host’s tools to switch PHP, you can upgrade with confidence.

Once you have a clear process and rollback plan, it becomes much easier to keep your site running on a fast, secure, and modern PHP version without constant worry. Bookmark this checklist and repeat it every time your host or Site Health recommends a newer PHP version.

Further Reading

Frequently Asked Questions

Can I update PHP from inside WordPress

Not directly. WordPress itself cannot change the PHP version running on your server, so the change needs to happen at the hosting level, usually via your control panel or by asking support.

Which PHP version should I choose for my WordPress site

In most situations, the best option is the latest stable PHP version your host offers and marks as recommended for WordPress. Very old releases (like 7.0 and below) are slower and may no longer receive security updates, which increases risk, so ask your host if you are unsure.

Will updating PHP break my WordPress site

Updating PHP does not automatically break your site, but outdated plugins or themes can misbehave under newer PHP versions. That is why it is essential to make a full backup, update all plugins and themes, and test your site right after changing PHP so you can roll back quickly if something goes wrong.

How long does it take to update PHP for WordPress

The actual switch in your hosting panel usually takes only a few seconds. Preparation takes longer because you need time for backups, plugin and theme updates, and basic testing, so planning at least 15–30 minutes keeps you from feeling rushed if you need to troubleshoot.

Do I need a developer to update PHP

Most site owners can update PHP themselves using hosting tools if they follow a step-by-step checklist. For complex ecommerce, membership, or custom-coded sites, involving a developer is wise when you are jumping from very old PHP versions to the latest one.

Is it safe to stay on an old PHP version

Sticking with an old PHP version for a long time is risky because unsupported versions stop receiving security patches. A safer long-term strategy is to keep your code (plugins and themes) updated and move your site onto a modern, supported PHP version so you benefit from ongoing fixes and performance improvements.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button