{"id":112660,"date":"2013-04-10T11:30:33","date_gmt":"2013-04-10T15:30:33","guid":{"rendered":"http:\/\/wpmu.org\/?p=112660"},"modified":"2013-04-10T18:05:48","modified_gmt":"2013-04-10T22:05:48","slug":"common-wordpress-problems-and-their-solutions","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/common-wordpress-problems-and-their-solutions\/","title":{"rendered":"Most Common WordPress Problems and Their Solutions"},"content":{"rendered":"<p dir=\"ltr\">WordPress is stable software and operates without issues most of the time. However, at times, things may go a little haywire, and your WP website can refuse to function normally.<\/p>\n<p dir=\"ltr\">Have you ever encountered a white screen after adding some new themes or plugins? Maybe you were just updating your WordPress website and that update now refuses to finish, and your website is in eternal maintenance mode? What about internal server and database connection errors?<\/p>\n<p dir=\"ltr\">If you have encountered any of the above problems and are looking for the solution to them, you have come to the right place. <strong>In this article, we shall be taking a look at some of the most common WordPress problems and ways in which we can solve them.\u00a0<\/strong><\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full-wide\">\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full-wide\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-ratio-full wp-image-112768\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/bigstock_vector_warning_sign_16955741-800x800.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"800\" height=\"800\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2>500 Internal Server Error<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">Your site was working fine, and then, when you wake up the next day, this is what you find:<\/p>\n<figure id=\"attachment_112675\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-112675\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/500-internal-server-error-new.png\" alt=\"Post image\" aria-hidden=\"true\" width=\"600\" height=\"181\" \/><figcaption class=\"wp-caption-text\">500 Internal Server Error<\/figcaption><\/figure>\n<h3>Why<\/h3>\n<p dir=\"ltr\">The most common cause of a 500 Internal Server Error message is a corrupt .htaccess file. Additional causes can be a conflicting plugin or theme, or even a corrupt WordPress installation.<\/p>\n<p dir=\"ltr\">Sometimes, PHP memory limits may also cause a 500 Internal Server Error. The easiest way to figure out where the problem lies is to check your website&#8217;s error_log (many shared web hosts often do not enable full error logging, though). To find out more, you can enable WP_DEBUG and check for error logs. Open up your wp-config.php file, and locate the following line of code:<\/p>\n<p dir=\"ltr\"><code>define('WP_DEBUG', false);<\/code><\/p>\n<p dir=\"ltr\">And change it to:<\/p>\n<p dir=\"ltr\"><code>define('WP_DEBUG', true);<\/code><\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">Since the most likely cause behind the error is a corrupt .htaccess file, let us tackle this one first.<\/p>\n<p dir=\"ltr\">You will need FTP access on your server. Navigate to the root directory of your WordPress installation, and locate the <code>.htaccess<\/code> file. Rename the file to, let us say, something like <code>.htaccess_old<\/code><\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-right cgrid-col-span-3\">\n<div class=\"cgrid-col-wide-right\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-112665\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/htaccess-maintenance.png\" alt=\"Post image\" aria-hidden=\"true\" width=\"196\" height=\"148\" \/><\/div>\n<\/div>\n<\/div>\n<p dir=\"ltr\">Now reload your website. If it works, congratulations! You can now generate a new .htaccess file simply by navigating to <strong>Settings&gt;Permalinks<\/strong> in your WP admin panel and re-saving the settings.<\/p>\n<p dir=\"ltr\">You can also try deactivating your plugins and themes because sometimes a 500 Internal Server Error can be caused by a faulty plugin or theme as well. Alternatively, you can try increasing your PHP Memory Limit to ensure that the memory limit is not the cause of the error. You can find detailed instructions regarding memory limits on the <a href=\"https:\/\/wordpress.org\/support\/article\/editing-wp-config-php\/#increasing-memory-allocated-to-php\" target=\"_blank\">WordPress Codex<\/a>.<\/p>\n<p dir=\"ltr\">If all else fails, you will need to grab a fresh copy of WordPress from the official site, and then re-upload the <code>wp-admin<\/code> and <code>wp-includes<\/code> directories.<\/p>\n<h2>White Screen of Death<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">As the name suggests, a White Screen of Death means when you access your website, you see nothing but a blank page.<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\">\n<figure id=\"attachment_185325\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-185325 size-full\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/wsod-1.jpg\" alt=\"The WordPress White Screen Of Death\" width=\"600\" height=\"418\" \/><figcaption class=\"wp-caption-text\">The White Screen Of Death &#8211; Nothing to see here, folks!<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<h3>Why<\/h3>\n<p dir=\"ltr\">There can be multiple reasons behind a WSOD, the most common ones being compatibility issues with a plugin or a theme. Of course, the \u201cincompatibility\u201d itself can have multiple faces: a plugin may have a conflict with another plugin, or a plugin may not be compatible with the latest version of WP. Similarly, a theme may also experience compatibility issues with WordPress after an update.<\/p>\n<h3>The Solution<\/h3>\n<figure id=\"attachment_112762\" class=\"wp-caption alignright\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-3-2 wp-image-112762\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/plugins-themes-ftp-2-448x345.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"448\" height=\"345\" \/><figcaption class=\"wp-caption-text\">Plugins and Themes Folders in WP Install Directory<\/figcaption><\/figure>\n<p>The easiest solution is to first isolate your plugins\u2019 directory. To do so, navigate to the root of your WP installation via FTP (assuming you cannot, at all, access your website and all you get is a WSOD), and then head to \/wp-content. Locate the folder named \u201cplugins\u201d and rename it (let us say, \u201cplugins_old\u201d). Create a new folder named &#8220;plugins&#8221;.<\/p>\n<p>This will isolate all your plugins, and if your website works fine, then yes, one of your plugins is at fault. Do not open your plugins page at this point, else you may end up deactivating all your plugins.<\/p>\n<p>Once you have verified that one of the plugins is behind the WSOD, you can copy individual plugin files from &#8220;plugins_old&#8221; to plugins&#8221;, one by one, to check which one is causing the WSOD.<\/p>\n<p>For themes, the procedure is even simpler. Navigate to \/wp-content\/themes, and then rename the folder of the active theme. Next, open up your WP admin panel, and head to the Themes page. This will cause WP to fall-back to the default theme (Twenty &#8220;something&#8221;, depending on your WP installation version). You can find a detailed step-by-step analysis <a href=\"https:\/\/wpmudev.com\/blog\/troubleshoot-white-screen-errors\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>If you have a tool like <a href=\"https:\/\/wpreset.com\/\" rel=\"noopener\" target=\"_blank\">WP Reset<\/a> installed, the solution is even more straightforward. Just load the Emergency Recovery Script (a part of the plugin that works autonomously), and turn off the plugins &amp; themes until you find the one that caused obstacles. Once you get to log back into your site, you will have a restore point (snapshot) ready. So, all you need is a few seconds to restore it and it will undo changes to your website caused by the bad update.<\/p>\n<h2>Maintenance Mode Error<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">This error:<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-112671\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/wp-maintenance-mode.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"650\" height=\"128\" \/><\/div>\n<\/div>\n<h3>Why<\/h3>\n<p dir=\"ltr\">Each time you update WordPress to a newer version, it makes a temporary .maintenance file. The problem occurs when the .maintenance file is not removed properly after the upgrade (in many cases, this happens when the upgrade process itself fails to complete successfully).<\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">You will need to login to your WP root directory via FTP. Once you&#8217;ve logged in, locate the <code>.maintenance<\/code> file and delete it. This will resolve the error.<\/p>\n<p dir=\"ltr\">If, however, you are experiencing difficulties with the automatic update, the solutions are different, and James Dunn has a <a href=\"https:\/\/wpmudev.com\/blog\/wordpress-updating-to-the-latest-version-errors-with-automatic-update\/\" target=\"_blank\">guide to help you out<\/a>.<\/p>\n<h2>Error Establishing A Database Connection<\/h2>\n<h3>What<\/h3>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-112663\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/database-connection.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"600\" height=\"78\" \/><\/div>\n<\/div>\n<p dir=\"ltr\">If you get the above error when you try to access your website, it means WordPress is experiencing a problem when trying to access the database.<\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">The direct cause can be an issue with the <code>wp-config.php<\/code> file &#8212; most likely, details related to your database have been entered incorrectly.<\/p>\n<p dir=\"ltr\">However, most of the time, database connection errors occur due to a problem that can be solved only by your web host (especially if you are on a shared hosting server). Most shared web hosting providers keep limits on databases, and if your database crosses the allotted quota, you can receive a connection error. Plus, database connection errors also occur if your web server is down.<\/p>\n<p dir=\"ltr\">Lastly, sometimes a hacked website can also result in database connection issues.<\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">First up, the wp-config.php file. Locate the file using FTP, and open it. You can then go through it to ensure that database details are correct (database name, username, password, and database host).<\/p>\n<p dir=\"ltr\">If you think your website has been hacked or compromised, you will have to work towards cleaning it up. You can use <a href=\"https:\/\/sitecheck.sucuri.net\/\" target=\"_blank\">Sucuri SiteCheck<\/a> to ensure that your website is clean &#8212; more details about securing a WP website can be found <a href=\"https:\/\/wpmudev.com\/blog\/removing-backdoor-exploits\/\" target=\"_blank\" rel=\"noopener\">in this article<\/a>. WordPress Codex also has an <a href=\"https:\/\/wordpress.org\/support\/article\/faq-my-site-was-hacked\/\" rel=\"noopener\" target=\"_blank\">FAQ<\/a> to help you out.<\/p>\n<p dir=\"ltr\">Lastly, if your web server is down or if your database has reached the allotted quota, you will obviously need to get in touch with your web hosting provider.<\/p>\n<h2>Connection Timed Out<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">An error that you receive from an overloaded server (or a badly configured server).<\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">It generally happens when the website\u2019s server is too overloaded and is unable to complete your browser\u2019s request. Nothing puts it more eloquently than the <a href=\"https:\/\/wordpress.org\/support\/article\/common-wordpress-errors\/\" rel=\"noopener\" target=\"_blank\">WordPress Codex<\/a>:<\/p>\n<blockquote>\n<p dir=\"ltr\">The Connection Timed Out error appears when your website is trying to do more than your server can manage.<\/p>\n<\/blockquote>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">The first step is to deactivate your plugins. If this cures the problem, try re-activating them one by one to see which plugin is causing the issue. Alternatively, if it is a problem related to your current theme, activate the default WP theme.<\/p>\n<p dir=\"ltr\">You can also increase your PHP memory limit using the wp-config.php file. Open the file, and add the following line of code to it:<\/p>\n<p dir=\"ltr\"><code>define('WP_MEMORY_LIMIT', '64M');<\/code><\/p>\n<p dir=\"ltr\">This will increase the memory limit to 64 MB. You should note, however, that if you are on a shared web host, you may not be allowed to increase your memory limit beyond a certain point. In this case, you will need to contact your web host to increase the memory limit for you. Also, bear in mind that many shared hosting providers keep the PHP memory limit as low as 8 MB.<\/p>\n<p dir=\"ltr\">Lastly, if you have access to your php.ini file, you can also consider <a href=\"https:\/\/wpmudev.com\/blog\/8-server-issues-that-affect-wordpress-and-what-to-do-about-them\/\" target=\"_blank\" rel=\"noopener\">increasing the maximum execution time<\/a>.<\/p>\n<h2>Error 145<\/h2>\n<h3>What<\/h3>\n<p>You get a message like &#8220;MySQL error code 145.&#8221;<\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">Error 145 means that your WordPress database is damaged or corrupted.<\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">The easiest way to repair your WP database is using phpMyAdmin.<\/p>\n<p dir=\"ltr\">Once you login to phpMyAdmin, choose your WP database. You will then need to select the checkboxes next to the tables that you wish to repair. Once selected, you can choose the \u201cRepair Table\u201d option from the drop-down menu right below the list of tables.<\/p>\n<figure id=\"attachment_112765\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-large wp-image-112765\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/repair-table-new-2-700x607.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"700\" height=\"607\" \/><figcaption class=\"wp-caption-text\">Repairing Tables Using phpMyAdmin<\/figcaption><\/figure>\n<p dir=\"ltr\"><strong>Note:<\/strong> Always create a backup of your database before making changes to it.<\/p>\n<h2>Error 28<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">Error 28 is more of a MySQL error and is not related to WordPress. Even Drupal, Joomla! or other CMS&#8217; websites can experience it.<\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">Error 28 can occur if the cache on your web server is full or if you have too many files in your \/tmp directory.<\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">If you can, then try to empty your \/tmp directory. Alternatively, you should contact your web host to help you resolve the cache related issues.<\/p>\n<h2>Warning: Cannot Modify Header Information &#8212; Headers Already Sent<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">Sometimes, you may encounter an error that goes along the lines of: <code>\"Warning: Cannot modify header information -- headers already sent by (output started at \/path-to-something-directory\/some-config-file:xyz )\"<\/code>.<\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">This error is caused by the unrequired spaces in the mentioned WordPress file (generally, it is the <code>wp-config.php<\/code> file). Naturally, you will need to edit the concerned file to <a href=\"https:\/\/wpmudev.com\/blog\/daily-tip-if-youre-getting-header-errors-try-deleting-empty-spaces-in-your-functions-file\/\" target=\"_blank\">remove the unnecessary whitespaces<\/a>.<\/p>\n<h3>The Solution<\/h3>\n<figure id=\"attachment_112664\" class=\"wp-caption alignright\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-112664\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/04\/headers-sent-error-space.png\" alt=\"Post image\" aria-hidden=\"true\" width=\"261\" height=\"128\" \/><figcaption class=\"wp-caption-text\">Remove Extra Spaces From wp-config.php File<\/figcaption><\/figure>\n<p dir=\"ltr\">Download the file that is mentioned in the error (say, wp-config.php). Open it using an editor of your choice, and then ensure that there are no spaces either before <code>&lt;?php<\/code> or after <code>?&gt;<\/code> tags. Overall, the first letters of the file should be <code>&lt;?php<\/code> and the last letters should be <code>?&gt;<\/code> (with absolutely no spaces between \u2018?\u2019 and \u2018&lt;\u2019 or \u2018&gt;\u2019 either).<\/p>\n<p dir=\"ltr\">As already mentioned, most of the time this error happens due to spaces in the wp-config.php file. It can be some other file too, though &#8212; just read the error carefully because it specifies the file name and the path to the concerned file.<\/p>\n<h2>Warning: File_Get_Contents<\/h2>\n<h3>What<\/h3>\n<p dir=\"ltr\">An error such as this one:<\/p>\n<p dir=\"ltr\"><code>Warning: file_get_contents (http:\/\/www.url.com\/url) [function:file-get-contents]: failed to open stream on line xyz<\/code><\/p>\n<h3>Why<\/h3>\n<p dir=\"ltr\">Most of the time, such errors occur because your web host has strict security settings in the PHP configuration (\u201csecurity\u201d not as in to prevent hacks, but to prevent overuse of server resources, etc.).<\/p>\n<h3>The Solution<\/h3>\n<p dir=\"ltr\">If you have access to the <code>php.ini<\/code> file, you can resolve the error yourself. Open the file, and locate the following line:<\/p>\n<p dir=\"ltr\"><code>allow_url_fopen = Off<\/code><\/p>\n<p dir=\"ltr\">Now change the \u201coff\u201d value to \u201con\u201d, as follows:<\/p>\n<p dir=\"ltr\"><code>allow_url_fopen = On<\/code><\/p>\n<p dir=\"ltr\">If you do not have access to your php.ini file, you will need to contact your web hosting provider and ask them to enable <code>allow_url_fopen<\/code>. Also, if this error is followed by a message such as <strong>&#8220;failed to open stream: no such file or directory in&#8230;&#8221;,\u00a0<\/strong>it can mean that the mentioned file is either missing or not readable (look for it in the specified path, and if you find it, check its file permissions).<\/p>\n<p dir=\"ltr\">There you have it &#8212; solutions to the most common WordPress errors! Got an error message or a solution of your own that I missed? Share it in the comments below!<\/p>\n<p>Photo: <a href=\"http:\/\/www.bigstockphoto.com\/image-16955741\/stock-vector-vector-warning-sign\" rel=\"noopener\" target=\"_blank\">vector warning sign<\/a> from BigStock<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looking for solutions to WP problems? Worried by database connection nightmares? Read on to find out how to cure some common WordPress ailments.<\/p>\n","protected":false},"author":152321,"featured_media":112768,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[235,263],"tags":[1004],"tutorials_categories":[],"class_list":["post-112660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-misc","category-tutorials","tag-database"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/152321"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=112660"}],"version-history":[{"count":8,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112660\/revisions"}],"predecessor-version":[{"id":189594,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112660\/revisions\/189594"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/112768"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=112660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=112660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=112660"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=112660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}