{"id":83463,"date":"2023-04-13T14:59:26","date_gmt":"2023-04-13T14:59:26","guid":{"rendered":"\/tutorials\/?p=83463"},"modified":"2026-09-03T12:49:04","modified_gmt":"2026-09-03T12:49:04","slug":"how-to-update-php-wordpress","status":"publish","type":"post","link":"\/my\/tutorials\/how-to-update-php-wordpress\/","title":{"rendered":"How to update PHP in WordPress safely"},"content":{"rendered":"<p class=\"wp-block-paragraph\">To update PHP in WordPress safely, first check that your WordPress version, theme, and plugins support the target PHP version, back up your site, and test the change on staging when possible. Then, update WordPress core, plugins, and themes before switching the PHP version in hPanel.<\/p><p class=\"wp-block-paragraph\">After the update, test your site for compatibility issues and be ready to revert to the previous PHP version if something breaks. In this guide, we&rsquo;ll walk through the complete WordPress PHP update process, including compatibility checks, backups, staging, WP-CLI preparation, hPanel configuration, and post-update testing.<\/p><p class=\"has-text-align-center wp-block-paragraph\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/WordPress-Security-Checklist.pdf\" target=\"_blank\" rel=\"noopener\">Download WordPress security checklist<\/a><\/p><p>\n\n\n\n\n<\/p><h2 id=\"h-why-update-php-version-in-wordpress\" class=\"wp-block-heading\">Why update PHP in WordPress?<\/h2><p class=\"wp-block-paragraph\">Updating PHP in WordPress helps keep your site compatible with current WordPress releases, plugins, and themes. As WordPress software evolves, developers may stop supporting older PHP versions or require a newer version for updates and new features.<\/p><p class=\"wp-block-paragraph\">Using a supported PHP version also reduces the risk of compatibility and security issues caused by outdated software. However, updating PHP can expose problems in older plugins, themes, or custom code, so check compatibility before making the change.<\/p><p class=\"wp-block-paragraph\">For this reason, a WordPress PHP update should be treated as a site-wide compatibility task rather than just a server setting change.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">As WordPress is based on PHP, you can <a href=\"\/my\/tutorials\/how-to-add-php-code-to-wordpress-post-or-page\/\">insert custom PHP code<\/a> to enhance your website's functionality.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 id=\"h-php-version-compatibility-for-wordpress\" class=\"wp-block-heading\">PHP version compatibility for WordPress<\/h2><p class=\"wp-block-paragraph\">While WordPress supports multiple PHP versions, we highly recommend using the latest version of PHP to ensure your website remains secure and up-to-date. However, note that not all WordPress versions are compatible with newer PHP releases.<\/p><p class=\"wp-block-paragraph\">Use the following chart to check whether your WordPress site supports the latest PHP version:<\/p><figure tabindex=\"0\" class=\"wp-block-table is-style-regular\"><table><tbody><tr><td><strong>WordPress Version<\/strong><\/td><td><strong>Supported PHP Versions<\/strong><\/td><\/tr><tr><td>5.0, 5.1<\/td><td>PHP 5.2, PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3<\/td><\/tr><tr><td>5.2<\/td><td>PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3<\/td><\/tr><tr><td>5.3, 5.4, 5.5<\/td><td>PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4<\/td><\/tr><tr><td>5.6, 5.7, 5.8<\/td><td>PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, <strong>PHP 8.0*<\/strong><\/td><\/tr><tr><td>5.9, 6.0<\/td><td>PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, <strong>PHP 8.0*<\/strong>, <strong>PHP 8.1*<\/strong><\/td><\/tr><tr><td>6.1, 6.2<\/td><td>PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, <strong>PHP 8.0*<\/strong>, <strong>PHP 8.1*<\/strong>, <strong>PHP 8.2*<\/strong><\/td><\/tr><tr><td>6.3<\/td><td>PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, <strong>PHP 8.0*<\/strong>, <strong>PHP 8.1*<\/strong>, <strong>PHP 8.2*<\/strong><\/td><\/tr><tr><td>6.4<\/td><td>PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4, <strong>PHP 8.0*<\/strong>, <strong>PHP 8.1*<\/strong>, <strong>PHP 8.2*<\/strong>, <strong>PHP 8.3*<\/strong><\/td><\/tr><\/tbody><\/table><\/figure><p class=\"wp-block-paragraph\">Note that the <strong>(*)<\/strong> symbol indicates the version of PHP is in the beta support phase or compatible but with exceptions, meaning you may encounter minor issues. Also, some themes and plugins may not support these PHP versions yet.<\/p><h2 id=\"h-how-to-update-php-in-wordpress\" class=\"wp-block-heading\">How to update PHP in WordPress<\/h2><p class=\"wp-block-paragraph\">Updating the PHP version in WordPress only takes several steps. However, you must be careful, as updating to an unsupported PHP version can break your WordPress website.<\/p><p class=\"wp-block-paragraph\">In this section, we will show you the safest ways to update PHP.<\/p><h3 class=\"wp-block-heading\">1. Check WordPress, theme, and plugin compatibility<\/h3><p class=\"wp-block-paragraph\">Before updating PHP, confirm that your WordPress installation supports the PHP version you plan to use. WordPress core may support a PHP version even when some plugins, themes, or custom code do not.<\/p><p class=\"wp-block-paragraph\">Start by checking your current WordPress and PHP versions in <strong>Tools &rarr; Site Health &rarr; Info<\/strong> in the WordPress dashboard. Then, verify that your WordPress version supports the target PHP version.<\/p><p class=\"wp-block-paragraph\">Next, review your active plugins and theme for compatibility. Check their requirements and update history, especially if they have not been updated recently. Older plugins, themes, and custom PHP code are more likely to cause errors after a PHP upgrade.<\/p><p class=\"wp-block-paragraph\">If any essential component does not support the target PHP version, update or replace it before proceeding. This reduces the risk of errors, broken functionality, or an inaccessible WordPress dashboard after the PHP change.<\/p><h3 id=\"h-2-create-a-backup-of-your-wordpress-site\" class=\"wp-block-heading\">2. Create a backup of your WordPress site<\/h3><p class=\"wp-block-paragraph\">Back up your WordPress site before changing the PHP version so you can restore it if the update causes compatibility issues.<\/p><p class=\"wp-block-paragraph\">Make sure the backup includes both your website files and database. Hostinger users can <a href=\"\/my\/tutorials\/how-to-backup-wordpress\/\">back up their WordPress site<\/a> directly from hPanel:<\/p><ol class=\"wp-block-list\">\n<li>On hPanel, go to <strong>Files<\/strong> &rarr; <strong>Backups<\/strong>.<\/li>\n\n\n\n<li>Choose the <strong>Generate new backup<\/strong> option &rarr; <strong>Select<\/strong>.<\/li>\n\n\n\n<li>A pop-up window will appear, asking for confirmation. Click <strong>Proceed<\/strong> to start the backup.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/my\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/generate-new-backup-hpanel.png\"><img decoding=\"async\" width=\"1024\" height=\"577\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/generate-new-backup-hpanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"Generate a new backup pop-up window on hPanel, with the Proceed button highlighted\" class=\"wp-image-83467\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/generate-new-backup-hpanel.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/generate-new-backup-hpanel-300x169.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/generate-new-backup-hpanel-150x85.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/generate-new-backup-hpanel-768x433.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Wait until the backup process is complete. It may take a while if your website has large amounts of data.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">Another option is to create a backup by using a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/updraftplus\/\" target=\"_blank\" rel=\"noopener\">UpdraftPlus WordPress Backup Plugin<\/a>. Here is how:<\/p><ol class=\"wp-block-list\">\n<li>Install and activate the UpdraftPlus plugin.<\/li>\n\n\n\n<li>Go to <strong>Settings<\/strong> &rarr; <strong>UpdraftPlus Backups<\/strong>.<\/li>\n\n\n\n<li>Click the <strong>Backup Now<\/strong> button.<\/li>\n\n\n\n<li>Select the database and website files options on the pop-up window. Then, click the <strong>Backup Now <\/strong>button<strong> <\/strong>to confirm the action.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/my\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/updfraftplus-backup.png\"><img decoding=\"async\" width=\"1024\" height=\"570\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/updfraftplus-backup.png\/w=1024,h=1024,fit=scale-down\" alt=\"UpdfraftPlus - Perform a backup pop-up window\n\" class=\"wp-image-83468\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/updfraftplus-backup.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/updfraftplus-backup-300x167.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/updfraftplus-backup-150x84.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/updfraftplus-backup-768x428.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>The backup process might take a while, depending on the size of your WordPress website files and database.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">Keep the backup available until you have confirmed that the site works correctly with the new PHP version. If the update causes errors that you cannot resolve quickly, revert to the previous PHP version and restore the backup if necessary.<\/p><h3 class=\"wp-block-heading\">3. Test the PHP update on a staging site<\/h3><p class=\"wp-block-paragraph\">Test the target PHP version on a staging copy of your WordPress site before applying it to the live website. A <a href=\"\/my\/tutorials\/wordpress-staging-environment\/\">WordPress staging environment<\/a> lets you identify compatibility issues without affecting visitors.<\/p><p class=\"wp-block-paragraph\">Create a staging copy that matches your live site, including its WordPress version, active theme, plugins, and custom code. If the staging site runs on a subdomain, you can <a href=\"\/my\/tutorials\/how-to-change-your-php-version\/\">change the PHP version for that specific subdomain<\/a> to test the target version without changing the live site&rsquo;s PHP configuration.<\/p><p class=\"wp-block-paragraph\">After switching PHP on staging, check the frontend and WordPress dashboard, test important forms and interactive features, and look for plugin or theme errors. If everything works as expected, proceed with preparing the live WordPress site for the PHP update.<\/p><p class=\"wp-block-paragraph\">If you encounter errors, resolve them on staging before changing PHP on the live site.<\/p><h3 id=\"h-3-update-the-wordpress-core-themes-and-plugins\" class=\"wp-block-heading\">4. Update the WordPress core, themes, and plugins<\/h3><p class=\"wp-block-paragraph\">Update WordPress core, plugins, and themes before changing PHP, so your site uses versions more likely to support the target PHP release.<\/p><p class=\"wp-block-paragraph\">From the WordPress dashboard, go to <strong>Dashboard &rarr; Updates<\/strong> and install any available WordPress, plugin, and theme updates. If you manage WordPress from the command line, you can also <a href=\"\/my\/tutorials\/wp-cli\/\">use WP-CLI<\/a> to update these components.<\/p><p class=\"wp-block-paragraph\">After updating, check that the site still works correctly on its current PHP version. Pay particular attention to important plugins, your active theme, forms, checkout functionality, and any custom code.<\/p><p class=\"wp-block-paragraph\">If an essential plugin or theme cannot be updated or does not support the target PHP version, resolve that compatibility issue before proceeding with the PHP change.<\/p><h3 class=\"wp-block-heading\">Optional: Prepare WordPress for the PHP update with WP-CLI<\/h3><p class=\"wp-block-paragraph\">You can also use WP-CLI to check your WordPress environment and update WordPress components before changing PHP in hPanel.<\/p><p class=\"wp-block-paragraph\">First, connect to your site through SSH and navigate to the WordPress installation directory. Then, check the PHP environment used by WP-CLI:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wp --info<\/pre><p class=\"wp-block-paragraph\">Look for the <strong>PHP version<\/strong> entry in the output. Keep in mind that WP-CLI uses the command-line PHP environment, which may differ from the PHP version serving your website.<\/p><p class=\"wp-block-paragraph\">Next, update WordPress core, plugins, and themes:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wp core update\nwp plugin update --all\nwp theme update --all<\/pre><p class=\"wp-block-paragraph\">Check your site after completing the updates to make sure everything still works correctly.<\/p><p class=\"wp-block-paragraph\">WP-CLI prepares the WordPress installation for the PHP upgrade, but it does not change the PHP version used by your website. For Hostinger sites, make that change through hPanel as described in the next step.<\/p><h3 id=\"h-4-update-the-php-version-of-your-wordpress-site\" class=\"wp-block-heading\">5. Update the PHP version of your WordPress site<\/h3><p class=\"wp-block-paragraph\">Change the PHP version of your WordPress site in hPanel after confirming that WordPress core, your theme, and plugins support the target version.<\/p><p class=\"wp-block-paragraph\">Hostinger users can <a href=\"\/my\/tutorials\/how-to-change-your-php-version\/\">change the PHP version<\/a> from the PHP Configuration settings:<\/p><ol class=\"wp-block-list\">\n<li>On hPanel, navigate to <strong>Advanced<\/strong> &rarr; <strong>PHP Configuration<\/strong>.<\/li>\n\n\n\n<li>Select the preferred PHP version and click <strong>Update<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/my\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-php-configuration-page.png\"><img decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-php-configuration-page.png\/w=1024,h=1024,fit=scale-down\" alt=\"The hPanel PHP Configuration page with the Update button highlighted\" class=\"wp-image-83473\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/hpanel-php-configuration-page.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/hpanel-php-configuration-page-300x171.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/hpanel-php-configuration-page-150x85.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/hpanel-php-configuration-page-768x437.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Click <strong>Confirm<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/my\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/change-php-version-confirmation-hpanel.png\"><img decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/change-php-version-confirmation-hpanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"Change PHP version confirmation box\" class=\"wp-image-83474\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/change-php-version-confirmation-hpanel.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/change-php-version-confirmation-hpanel-300x170.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/change-php-version-confirmation-hpanel-150x85.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/04\/change-php-version-confirmation-hpanel-768x434.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Wait until the update process is complete.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">The new PHP version will apply to your live WordPress site. Don&rsquo;t consider the update complete yet &ndash; test the site immediately afterward to make sure its frontend, WordPress dashboard, plugins, and other important functionality still work correctly.<\/p><h3 class=\"wp-block-heading\">6. Test your WordPress site after updating PHP<\/h3><p class=\"wp-block-paragraph\">Test your WordPress site immediately after changing PHP to confirm that the new version does not cause compatibility or functionality issues.<\/p><p class=\"wp-block-paragraph\">Check both the frontend and WordPress dashboard. Review the pages and features that matter most to your site, including:<\/p><ul class=\"wp-block-list\">\n<li>navigation and page layouts<\/li>\n\n\n\n<li>forms and login functionality<\/li>\n\n\n\n<li>plugins and widgets<\/li>\n\n\n\n<li>ecommerce checkout and payment flows, if applicable<\/li>\n\n\n\n<li>custom features or PHP-based integrations<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Also go to <strong>Tools &rarr; Site Health<\/strong> in the WordPress dashboard and check for critical issues or recommendations related to PHP, plugins, themes, or server configuration.<\/p><p class=\"wp-block-paragraph\">If you notice errors, broken layouts, missing features, or an inaccessible dashboard, revert to the previous PHP version first. Then troubleshoot the affected plugin, theme, or custom code before trying the upgrade again.<\/p><h2 class=\"wp-block-heading\" id=\"h-what-to-do-if-wordpress-breaks-after-updating-php\">What to do if WordPress breaks after updating PHP<\/h2><p class=\"wp-block-paragraph\">If your WordPress site breaks after updating PHP, switch back to the previous PHP version first to restore the site while you investigate the compatibility issue.<\/p><p class=\"wp-block-paragraph\">Once the site is working again, identify what caused the problem:<\/p><ul class=\"wp-block-list\">\n<li>Check whether WordPress reports errors in <strong>Tools &rarr; Site Health<\/strong>.<\/li>\n\n\n\n<li><a href=\"\/my\/tutorials\/php-error-log\/\">Check the PHP error log<\/a> for errors related to a plugin, theme, or custom code.<\/li>\n\n\n\n<li>Disable incompatible plugins one at a time to isolate the issue.<\/li>\n\n\n\n<li>Temporarily switch to a default WordPress theme if the problem appears theme-related.<\/li>\n\n\n\n<li>Check custom PHP code for functions or syntax that the newer PHP version no longer supports.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Make and test any fixes on a staging site before trying the PHP update again. If you cannot resolve the compatibility issue immediately, keep using the previous supported PHP version until the affected component is updated or replaced.<\/p><p class=\"wp-block-paragraph\">Hostinger users can also contact Customer Success through hPanel if they need help identifying a PHP configuration or compatibility issue.<\/p><h2 id=\"h-conclusion\" class=\"wp-block-heading\">Next steps after updating PHP in WordPress<\/h2><p class=\"wp-block-paragraph\">After updating PHP in WordPress, keep WordPress core, plugins, and themes up to date so they remain compatible with supported PHP versions.<\/p><p class=\"wp-block-paragraph\">From here, you can:<\/p><ul class=\"wp-block-list\">\n<li>Review <a href=\"\/my\/tutorials\/wordpress-maintenance\/\">WordPress maintenance tasks<\/a> to keep your site secure and reliable.<\/li>\n\n\n\n<li>Monitor <strong>Tools &rarr; Site Health<\/strong> for new compatibility or configuration issues.<\/li>\n\n\n\n<li>Test future PHP upgrades on a staging site before applying them to your live website.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Keeping PHP and WordPress components current helps reduce compatibility problems and makes future upgrades easier to manage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To update PHP in WordPress safely, first check that your WordPress version, theme, and plugins support the target PHP version, back up your site, and test the change on staging when possible. Then, update WordPress core, plugins, and themes before switching the PHP version in hPanel. After the update, test your site for compatibility issues [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/how-to-update-php-wordpress\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":258,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Update PHP in WordPress + Safe Upgrading Tips","rank_math_description":"Check this article to learn how to update PHP in WordPress: 1. Check PHP version 2. Check required PHP version 3. Back up your site + more.","rank_math_focus_keyword":"how to update php in wordpress","footnotes":""},"categories":[22666],"tags":[],"class_list":["post-83463","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/atualizar-php-wordpress\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/mettre-a-jour-php-wordpress\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-actualizar-php-en-wordpress\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-update-php-wordpress\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-update-php-wordpress\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-actualizar-php-en-wordpress\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-actualizar-php-en-wordpress\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-actualizar-php-en-wordpress\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/atualizar-php-wordpress\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/83463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/258"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=83463"}],"version-history":[{"count":14,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/83463\/revisions"}],"predecessor-version":[{"id":133898,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/83463\/revisions\/133898"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=83463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=83463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=83463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}