{"id":25930,"date":"2020-12-21T02:55:22","date_gmt":"2020-12-20T18:55:22","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=25930"},"modified":"2022-09-08T21:26:10","modified_gmt":"2022-09-08T13:26:10","slug":"how-to-fix-high-cpu-usage-in-wordpress","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-fix-high-cpu-usage-in-wordpress","title":{"rendered":"HOW TO: Fix High CPU usage in WordPress"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"25930\" class=\"elementor elementor-25930\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-08431ef elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"08431ef\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e74a206\" data-id=\"e74a206\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-32aea7f elementor-widget elementor-widget-heading\" data-id=\"32aea7f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-medium\">HOW TO: Fix High CPU usage in WordPress\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-afd6111 elementor-widget elementor-widget-text-editor\" data-id=\"afd6111\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>By reading this article, you will learn to solve the problem of having high CPU usage in WordPress on your own. Besides, you can check out our <a href=\"https:\/\/www.casbay.com\/business-hosting\">Hosting services<\/a> for more information. There are several ways that we recommend you to use:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-61937d0 elementor-widget elementor-widget-heading\" data-id=\"61937d0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">1. Update WordPress<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-56af5ad elementor-widget elementor-widget-text-editor\" data-id=\"56af5ad\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>If you\u2019re not using the latest version of WordPress\u00a0<a href=\"https:\/\/codex.wordpress.org\/Updating_WordPress\" rel=\"noopener\">update now<\/a>. Make sure you backup your site first!<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-90dc375 elementor-widget elementor-widget-heading\" data-id=\"90dc375\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">2. Update Plugins<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fb6e5fb elementor-widget elementor-widget-text-editor\" data-id=\"fb6e5fb\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Updating your WordPress plugins to the latest versions can often reduce high CPU usage. If you\u2019re running an old version take a moment to update now.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-db5b402 elementor-widget elementor-widget-heading\" data-id=\"db5b402\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">3. Avoid beta versions of plugins<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1c6871b elementor-widget elementor-widget-text-editor\" data-id=\"1c6871b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Whilst it\u2019s cool to be at the cutting-edge, only use stable versions of WordPress plugins. Sometimes early release versions (also known as alpha or beta) can have bugs in the code which can cause CPU spikes.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bec28e6 elementor-widget elementor-widget-heading\" data-id=\"bec28e6\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">4. Install a caching plugin<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3256ece elementor-widget elementor-widget-text-editor\" data-id=\"3256ece\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Caching plugins such as\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/w3-total-cache\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-wpel-link=\"external\">W3 Total Cache<\/a>\u00a0and\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/wp-super-cache\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-wpel-link=\"external\">WP Super Cache<\/a> can dramatically reduce CPU load by caching static copies of your pages on your webspace. Static files use less CPU and memory. Keeping you within your shared hosting limits.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7ae2690 elementor-widget elementor-widget-heading\" data-id=\"7ae2690\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">5. Disable WP-Cron<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-15eda3f elementor-widget elementor-widget-text-editor\" data-id=\"15eda3f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>WP-Cron manages all the scheduled events on your WordPress site. WP-Cron is a <em>very<\/em> common cause of high CPU loads as it is called every time someone visits your website.\u00a0Disabling WP-Cron and replacing it with a real cron\u00a0job can drastically reduce CPU-load and prevent the chances your account is suspended due to exceeding your resources.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8d3b483 elementor-widget elementor-widget-heading\" data-id=\"8d3b483\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">6. Only use plugins you\u00a0really\u00a0need<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6097601 elementor-widget elementor-widget-text-editor\" data-id=\"6097601\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Do you really need that plugin that constantly checks for broken links? \u2013 The more WordPress plugins you have installed, the longer your site will take to load. Deactivate and delete any plugin that you don\u2019t need. Aim for just a handful of plugins. This will speed up your site and keep your visitors happy.<\/p><p>If you\u2019ve disabled plugins you don\u2019t need, and still have high CPU usage you\u2019ll need to try debugging each plugin to see if it\u2019s the cause of the CPU spike. First make sure you\u2019ve taken a backup of your entire WordPress site (files and database). Now try disabling each plugin one by one until the CPU load has been resolved. Once you\u2019ve found the faulty plugin you should hopefully be able to reenable the others without seeing the CPU problems.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a8194ae elementor-widget elementor-widget-heading\" data-id=\"a8194ae\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">7. Avoid resource-hungry plugins<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-eee03a5 elementor-widget elementor-widget-text-editor\" data-id=\"eee03a5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>If using WooCommerce, or similar resource-hungry plugins, make sure your web hosting has sufficient resources.<\/p><p>If you\u2019re running CPU and Memory intensive plugins on a standard shared-hosting, or budget VPS hosting you may find your site performs badly due to insufficient server resources. Symptoms include slow loading pages, database errors and increased visitor abandonment.<\/p><p>With many web hosts, if you try running CPU intensive WordPress plugins on a shared-hosting package you risk your site being suspended due to high-CPU loads.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-570d17c elementor-widget elementor-widget-heading\" data-id=\"570d17c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">8. Avoid buggy WordPress Themes<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7b55051 elementor-widget elementor-widget-text-editor\" data-id=\"7b55051\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>A badly written WordPress Theme or one written with demanding features such as server-side image resizing can be CPU intensive. To rule out problems with your WordPress theme try the following:<\/p><ul><li>Check error logs for problems. Login to cPanel and check the Error logs for errors.<\/li><li>Contact the theme developer and ask if there\u2019s any known issues.<\/li><li>Disable any dynamic features built into the theme such as thumbnail resizing. Some WordPress themes have their own image resizing modules which can cause high CPU usage. If possible we recommend disabling them in favour of using the more efficient image resizing built into the WordPress core.<\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f51e9a0 elementor-widget elementor-widget-heading\" data-id=\"f51e9a0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">9. Ask the WordPress Community for help<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0317659 elementor-widget elementor-widget-text-editor\" data-id=\"0317659\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Try searching\u00a0<a href=\"https:\/\/wordpress.org\/support\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-wpel-link=\"external\">WordPress Forums<\/a>\u00a0for answers. If there\u2019s a known problem with a plugin there\u2019s a good chance someone will have provided a solution. For example searching\u00a0<a href=\"https:\/\/wordpress.org\/search\/yarrp+cpu?forums=1\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-wpel-link=\"external\">yarrp cpu<\/a>\u00a0has lot\u2019s of hits.<\/p><p>You can disable WP-Cron by\u00a0<a href=\"https:\/\/codex.wordpress.org\/Editing_wp-config.php\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-wpel-link=\"external\">editing your wp-config.php<\/a>\u00a0and adding the following line;<\/p><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td>1<\/td><td><code>define(<\/code><code>'DISABLE_WP_CRON'<\/code><code>, true);<\/code><\/td><\/tr><\/tbody><\/table><p>You can create a\u00a0cron job\u00a0and run wp-cron.php every hour using the following command:<\/p><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td>1<\/td><td><code>wget https:<\/code><code>\/\/www<\/code><code>.yourwebsite.com<\/code><code>\/wp-cron<\/code><code>.php &gt;\u00a0<\/code><code>\/dev\/null<\/code>\u00a0<code>2&gt;&amp;1<\/code><\/td><\/tr><\/tbody><\/table><p><em>Replace www.yourwebsite.com with your web address<\/em><\/p><p>The cron job will ensure your WordPress site\u2019s scheduled tasks get completed, such as scheduled posts, WP super cache garbage collection, etc.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e136bc0 elementor-widget elementor-widget-heading\" data-id=\"e136bc0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">10. Use PHP 7<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c0d2d46 elementor-widget elementor-widget-text-editor\" data-id=\"c0d2d46\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Switching to PHP 7 can dramatically speed up your WordPress website, reducing loading time and freeing up CPU and memory.\u00a0We recommend testing a staging version of your website with PHP 7 before changing the production version.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-16f9040 elementor-widget elementor-widget-heading\" data-id=\"16f9040\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">11. Increase PHP Memory Limit<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d171c91 elementor-widget elementor-widget-text-editor\" data-id=\"d171c91\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Occasionally increasing the amount of memory available to your WordPress website can help fix high CPU errors in WordPress. We recommend increasing your PHP memory to at least 64MB, and recommend 256MB.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ed8d746 elementor-widget elementor-widget-text-editor\" data-id=\"ed8d746\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Now you have learned how to fix high CPU usage in WordPress. Read More on <em><a href=\"https:\/\/www.casbay.com\/guide\/kb\/how-to-install-wordpress-on-vestacp\/\">How to install WordPress on VestaCP<\/a><\/em>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>HOW TO: Fix High CPU usage in WordPress By reading this article, you will learn to solve the problem of having high CPU usage in WordPress on your own. Besides, you can check out our Hosting services for more information. There are several ways that we recommend you to use: 1. Update WordPress If you\u2019re [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[43],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25930"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=25930"}],"version-history":[{"count":8,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25930\/revisions"}],"predecessor-version":[{"id":36974,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25930\/revisions\/36974"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=25930"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=25930"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=25930"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=25930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}