{"id":4871,"date":"2019-09-18T07:56:50","date_gmt":"2019-09-18T07:56:50","guid":{"rendered":"https:\/\/shortpixel.com/blog\/?p=4871"},"modified":"2023-04-11T12:16:47","modified_gmt":"2023-04-11T09:16:47","slug":"how-to-fix-wordpress-errors-that-affect-site-performances","status":"publish","type":"post","link":"https:\/\/shortpixel.com\/blog\/how-to-fix-wordpress-errors-that-affect-site-performances\/","title":{"rendered":"How to fix 11 performance killing WordPress errors"},"content":{"rendered":"<p><a href=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-4889 size-large\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors-1024x682.jpg\" alt=\"Fix WordPress errors\" width=\"604\" height=\"402\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors-1024x682.jpg 1024w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors-300x200.jpg 300w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors-768x512.jpg 768w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/WordPress-errors.jpg 1280w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/a>Some WordPress errors could make your site inaccessible to web users. In this article, I\u2019ll share with you 11 performance killing WordPress errors and how to fix them.<\/p>\n<p>WordPress is the most popular content management system (CMS), with a solid market share of 63.5%. In fact, <a href=\"https:\/\/kinsta.com\/wordpress-market-share\/\" target=\"_blank\" rel=\"noopener\">43% of all websites online run on WordPress<\/a>. WordPress powers top sites like the New York Times, Boing Boing, and Business Insider. While WordPress is powerful and popular, this doesn\u2019t mean that it\u2019s perfect. Sometimes, you may run into serious problems that could kill your performance.<\/p>\n<p><!--more--><\/p>\n<h2>1. Database Connection Error<\/h2>\n<p>WordPress uses MySQL as its database software. A database is where your generated WordPress data is stored. For example, it\u2019s where your blog posts, pages, comments, tags, etc. are stored. If WordPress can\u2019t connect to MySQL, nobody will be able to access the information on your site, including you. Solving this error is a tough task for WordPress beginners. But you can do it.<\/p>\n<p>However, if programming or PHP code frighten you, then you may want to call your web developer, otherwise here is how to fix this WordPress error. Login to your web hosting service and go to cPanel. Inside cPanel, you\u2019ll see File Manager. While inside File Manager, click the \u201cpublic_html\u201d folder. Once there, look for the wp-config.php file. This file contains the configuration settings for your WordPress site. Inside the file, search for \u201cDB_NAME,\u201d \u201cDB_USER,\u201d \u201cDB_PASSWORD,\u201d and \u201cDB_HOST.\u201d<\/p>\n<p><a href=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/MySQL-database.png\"><img decoding=\"async\" class=\"aligncenter wp-image-4880 size-large\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/MySQL-database-1024x476.png\" alt=\"MySQL database error solving\" width=\"604\" height=\"281\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/MySQL-database-1024x476.png 1024w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/MySQL-database-300x139.png 300w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/MySQL-database-768x357.png 768w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/MySQL-database.png 1070w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/a>If you don\u2019t have these details, you should contact your web hosting company. But, if you know the information, you should fill them. For instance, here\u2019s how you fill the database name: define( &#8216;DB_NAME&#8217;, &#8216;yourdatabasename&#8217; );<br \/>\nAnd fill your database user and password that way too. Put the information where you are asked to, following the way I filled the database name example given in the above paragraph. After inputting the correct information, WordPress should be able to connect to your database, and your site should be live again.<\/p>\n<h2>2. Fixing 404 WordPress Error<\/h2>\n<p>404 errors could occur for different reasons. If your WordPress site\u2019s permalinks setting isn\u2019t well fixed, you can have lots of 404 errors. Old, stale, deleted content could also cause 404 errors. One or two 404 errors may not hurt your site. But many 404 errors may damage your site\u2019s trust in the eyes of web users and search engines. The presence of 404 errors won&#8217;t encourage prospects to buy your product or service. So, how can you fix it?<\/p>\n<p>First, go to your WordPress admin dashboard and click \u201cSettings.\u201d After doing that, click \u201cPermalinks.\u201d Inside \u201cPermalinks,\u201d select \u201cPost name.\u201d Use a WordPress plugin like <a href=\"https:\/\/wordpress.org\/plugins\/broken-link-checker\/\" target=\"_blank\" rel=\"noopener\">Broken Link Checker<\/a> to find all the broken links on your site. You\u2019ll be able to fix the backlink without going to the post or page where it is located.<\/p>\n<h2>3. How to fix Syntax Error in WordPress<\/h2>\n<p>Syntax errors are common when writing programs in a popular language like PHP. Note that WordPress is written in PHP. When you write something PHP doesn\u2019t recognize, you\u2019ll receive a syntax error. I started coding after seeing and troubleshooting syntax errors in WordPress. And since then &#8211; 11 years ago, I\u2019ve improved my coding skills. WordPress will tell you the exact line where a syntax error is located. If you know some PHP code, you can go to that line in your WordPress files through File Manager inside cPanel. Go to that line and use the correct PHP keyword. If you don\u2019t know what the correct keyword is, you can do a quick search on Google on each word that appeared on the line.<br \/>\nFor example, PHP keywords like \u201cthis\u201d or \u201cforeach\u201d could have been miswritten to \u201ctis\u201d or \u201cforeac.\u201d<\/p>\n<h2>4. Fix a Memory Exhaustion Error<\/h2>\n<p>Memory exhaustion error is common in WordPress. Most times, this is due to hosting on a cheap web hosting service. There are lots of $4 per month hosting services out there. Being cheap makes them appealing, but the truth is that they offer low-quality services. Cheap services don\u2019t provide phone support. And most of their live chat support is slow. Some could take 30 minutes before they respond to you on live chat.<\/p>\n<p>If your WordPress hosting provider is cheap, expect to get a memory exhaustion error when your sites start receiving some decent traffic. Low-cost web hosting services start having problems when your site begins to receive 5,000 \u2013 10,000 visits per month. This error makes your site inaccessible to web users. If prospects can\u2019t view your site, there\u2019s no way they\u2019ll buy your products or services.<\/p>\n<p>There are three ways to fix this error. The first solution is to upgrade to a better hosting plan with your current provider. The second solution is to move to a better and more reliable web hosting service. The third solution is only possible if you\u2019ve been told that your current plan can handle the number of visits you receive. You need to get into the \u201cwp-config.php\u201d in your WordPress files and add this line of code:<br \/>\ndefine( \u2018WP_MEMORY_LIMIT\u2019, \u2018256M\u2019 );<br \/>\nThe code tells WordPress to raise your PHP memory limit to 256MB.<\/p>\n<h2>5. 502 Bad Gateway Error and how to fix it in WordPress<\/h2>\n<p>A 502 bad gateway error is triggered when your request takes too long for the server to respond. There are a few reasons why your WordPress site may return 502. The error could be caused by a temporary high traffic. As I stated above, this could be solved by simply upgrading to a better hosting plan that can handle the traffic. The error can also be triggered by a purely coded WordPress theme or plugin. There are tens of thousands of WordPress themes and plugins out there. Many of them are free and coded by newbies.<br \/>\nIf you\u2019ve installed a poorly coded theme or plugin, you\u2019ll have to uninstall it to solve this error. So, uninstall each theme and plugin you\u2019ve installed. If you\u2019ve uninstalled all your plugins, uninstall the theme too. If you\u2019ve done that and your WordPress site is still showing the error, it may be time to contact your WordPress hosting provider.<\/p>\n<h2>6. 504 Gateway Time-out Error<\/h2>\n<p>This error is usually triggered when the server is unable to connect to an upstream server for it to complete a request. You\u2019re more likely to see a 504 gateway time-out error if your WordPress is using a website firewall like Cloudflare or Sucuri. What these services do is protect your site against attacks from malicious parties. But sometimes, their own servers could be down. When their servers are down, your WordPress site becomes inaccessible.<br \/>\nHow to fix this WordPress error?<\/p>\n<p>You may need to turn off their service on your WordPress site. You continue using them when their servers are up and running again. But their servers are rarely down. They have servers spread across different parts of the world. So, if you use a reliable service like Cloudflare and Sucuri, you should rest assured that you won\u2019t have to deal with this error that much.<\/p>\n<h2>7. Failed to Open Stream Error<\/h2>\n<p>This is another common WordPress error. You may find this error challenging if you don\u2019t know any PHP. The \u201cfailed to open stream\u201d error simply means that WordPress can\u2019t load a file in your website code. If you see this error, it\u2019s a sign that your WordPress developer didn\u2019t do a good job. It may be time to find another developer who knows what to do and who can ensure that there isn\u2019t any error in their PHP code.<\/p>\n<p>How to fix this WordPress error?<\/p>\n<p>If you coded your WordPress site yourself, you have to solve the problem yourself. The error isn&#8217;t a big deal even if you aren\u2019t an experienced WordPress developer. The error message will tell you the line the mistake is in. Find that line. It could be that the file or folder specified doesn\u2019t exist. Make sure you have the correct file and put it in the line. After doing that, refresh your WordPress site to see if it\u2019s still returning that error. If it\u2019s still returning the \u201cfailed to open stream\u201d error, it may be time to hire a WordPress developer to code your site. If you continue to code your site, you may encounter lots of vulnerabilities only a senior or experienced developer could detect and fix.<\/p>\n<h2>8. 500 Internal Server Error<\/h2>\n<p>The 500 internal server error is the most confusing and challenging WordPress error for a beginner. When you see this error, it means something is wrong somewhere in your code, but WordPress won\u2019t tell you where. Check to see if you recently updated a WordPress plugin or theme. I hope your web hosting service offers daily backups. If it does, you can always revert to the day or week before you made the update. This definitely is a\u00a0performance killing WordPress error.<\/p>\n<p>A corrupted .htaccess file could also trigger the error. You\u2019ll find this file inside your WordPress files, in the same folder where wp-config.php is located. You can rename the \u201c.htaccess\u201d file to something like \u201c.htaccess_old.\u201d<\/p>\n<p><a href=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Internal-server-error.png\"><img decoding=\"async\" class=\"aligncenter wp-image-4881 size-full\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Internal-server-error.png\" alt=\"Internal server error problem solve\" width=\"507\" height=\"573\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Internal-server-error.png 507w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Internal-server-error-265x300.png 265w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/a>If the error doesn\u2019t go away after doing this, then you should contact your web hosting service immediately.<\/p>\n<h2>9. WordPress White Screen of Death Error<\/h2>\n<p>This is one of the most popular and annoying WordPress errors. The error gives you a plain white screen. No error messages. Nothing. The error could occur as a result of a script exhausting the memory limit of your WordPress site. The script may get killed by your web hosting provider, which is why you may not see any error message, and you see a plain white screen. You may need to increase your WordPress site\u2019s memory limit. I mentioned this solution above, and I\u2019ll do that again. Here is how to fix WordPress error: simply paste this into your \u201cwp-config.php\u201d file:<br \/>\ndefine( &#8216;WP_MEMORY_LIMIT&#8217;, &#8216;256M&#8217; );<\/p>\n<h2>10. Maximum Execution Time Exceeded Error<\/h2>\n<p>In PHP, there\u2019s a limit to how long a script can run. And don\u2019t forget that WordPress is coded in the PHP programming language. Some WordPress hosting services may set the value of this time to be higher, while others may set it to be lower. It depends on the plan you\u2019re on. Higher plans let you run scripts for a longer time. Fixing this error is easy. Go to your WordPress folder in File Manager inside cPanel. Find the .htaccess file. Paste this code before \u201c# END WordPress\u201d:<br \/>\n\u201cphp_value max_execution_time 300\u201d<\/p>\n<h2><a href=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Maximum-Execution-Time-Exceeded.png\"><img decoding=\"async\" class=\"aligncenter wp-image-4882 size-full\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Maximum-Execution-Time-Exceeded.png\" alt=\"Maximum Execution Time Exceeded Error solve\" width=\"958\" height=\"310\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Maximum-Execution-Time-Exceeded.png 958w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Maximum-Execution-Time-Exceeded-300x97.png 300w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Maximum-Execution-Time-Exceeded-768x249.png 768w\" sizes=\"(max-width: 958px) 100vw, 958px\" \/><\/a>11. Mixed Content Error<\/h2>\n<p>Mixed content is simply having a file(s) that is \u201chttp:\/\/\u201d when the site is \u201chttps:\/\/.\u201d In case you don\u2019t know, having the \u201chttps:\/\/\u201d in front of your website address makes web users feel secure. Your address will have the green padlock in front of it in the browser. For example, the address of <a href=\"https:\/\/www.omnikick.com\/\" target=\"_blank\" rel=\"noopener\">OmniKick<\/a> has the padlock button because it\u2019s \u201chttps:\/\/.\u201d<br \/>\nPerhaps the site was still \u201chttp:\/\/\u201d when you uploaded some images. Now that you have \u201chttps:\/\/,\u201d you\u2019ll have to convert those files to \u201chttps:\/\/.\u201d If you don\u2019t convert them, some visitors will get a warning message from their browser telling them that some of your files aren\u2019t secure.<\/p>\n<p>With a simple plugin like <a href=\"https:\/\/wordpress.org\/plugins\/ssl-insecure-content-fixer\/\" target=\"_blank\" rel=\"noopener\">SSL Insecure Content Fixer<\/a>, you can get rid of mixed content errors. Install the plugin and go to \u201cSettings\u201d in the admin menu. Then click \u201cSSL Insecure Content.\u201d Select \u201cSimple\u201d and click on \u201cSave Changes\u201d to make the change.<\/p>\n<p><a href=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Mixed-Content-Error.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-4883\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2019\/09\/Mixed-Content-Error.png\" alt=\"SSL Insecure Content Fixer\" width=\"800\" height=\"343\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Mixed-Content-Error.png 800w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Mixed-Content-Error-300x129.png 300w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2019\/09\/Mixed-Content-Error-768x329.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a>By clicking on <em>save<\/em>, all files with \u201chttp:\/\/\u201d will now have \u201chttps:\/\/\u201d in front of their addresses.<\/p>\n<h3>Conclusion<\/h3>\n<p>WordPress will continue to be the best content management system for many years to come, as no other CMS is close to beating WordPress. While some of these errors may look challenging to you, they are in fact really simple to solve. And the more you solve them, the more you know about WordPress and even PHP.<\/p>\n<p>WordPress made me interested in learning PHP. And I relish every moment I\u2019ve spent finding solutions to the above errors.<\/p>\n<p><strong>Author&#8217;s bio<\/strong>: Michael Akinlabi is the senior content crafter at <a href=\"https:\/\/www.omnikick.com\/\" target=\"_blank\" rel=\"noopener\">OmniKick<\/a>, a startup that creates exciting lead generation popups, and he&#8217;s also a marketing instructor at <a href=\"https:\/\/www.intentmarketer.com\/\" target=\"_blank\" rel=\"noopener\">Intent Marketer<\/a>. When he\u2019s not writing, Michael is sightseeing, reading, and coding in PHP.<\/p>\n<p><a href=\"https:\/\/pixabay.com\/photos\/broken-business-monitor-2237920\/\" target=\"_blank\" rel=\"noopener\">Image 1<\/a> by Mediamodifier from pixabay.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some WordPress errors could make your site inaccessible to web users. In this article, I\u2019ll share with you 11 performance killing WordPress errors and how to fix them. WordPress is the most popular content management system (CMS), with a solid market share of 63.5%. In fact, 43% of all websites online run on WordPress. WordPress [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4871","post","type-post","status-publish","format-standard","hentry","category-world-of-wordpress"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/4871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/comments?post=4871"}],"version-history":[{"count":13,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/4871\/revisions"}],"predecessor-version":[{"id":7569,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/4871\/revisions\/7569"}],"wp:attachment":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/media?parent=4871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/categories?post=4871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/tags?post=4871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}