WordPress errors are no joke. They can make your site inaccessible to visitors, create security vulnerabilities, result in a less than desirable user experience and just make you seem plain unprofessional. And they’re also annoyingly common!
If you’re done with the screams of frustration – “WHY WON’T IT JUST WORK” – and tearing your hair out, and the rational part of you has re-taken control and is looking for answers, you’ve come to the right place. We put together this resource to help WordPress users just like you resolve some of the more common WordPress errors that can arise.
But I’m definitely no WordPress expert. So I got in touch with over 30 people that are. They resolve WordPress errors for a living and between them have come across just about every error you could face on your own site. The idea was simple. We asked each of them to talk about an error they have routinely encountered and provide some potential solutions.
The result? A fairly comprehensive rundown of common WP errors and their solutions that can act as your guiding light in a time of need. We hope it helps preserve your sanity!
The Most Common WordPress Errors
Having encountered a range of WordPress errors over the years, I was pretty curious to find out which are the most common. Which errors are WordPress pros coming across most frequently?
So I did what I do best and asked the question as part of our research. Each WP pro that took part in this article was asked to name the 3 most common WordPress errors that they encounter. This data was compiled, sorted and used to put together the chart you can see below.
As you can see, Internal Server Errors and the “White Screen of Death” (is it just me or does the name of this error make you feel like your life is over?!) were by far the most common WordPress errors referenced in this poll.
If you’re a budding developer or someone who relies on WordPress heavily, it may be worth taking note of these errors in particular and learning how you can resolve them. Because it looks as though you’ll definitely be facing them at some point!
An Overview of the WordPress Errors + Problems Covered in This Post
When you see a WordPress error message appear before your eyes, you might feel worried, frustrated or even a little helpless. But whatever your emotion, you want to fix that error as quickly as possible.
Not to worry. Our group of experts has got you covered. Below you can see a quick rundown of all the WordPress errors that you can find solutions for in this article. Find whichever one you’re currently trying to fix, and skip right to the solution.
- Exceeds the Maximum Upload Size for this Site
- Stuck in Maintenance Mode
- White Screen of Death
- WordPress Website Not Sending Email
- PHP Version Mismatch
- Connection is Timing Out (504 Error)
- Internal Server Error (Error 500)
- HTTP Error During Media Upload
- Bad connection to your REST API
- Broken Links on Your Website
- “Your Connection Is Not Private” SSL Issues
- Critical Error on Website
- WordPress Migration Fails and is Not Working as Expected
- Broken Images in Media Gallery
- WordPress Redirecting to Old URL When an Installation or URL is Migrated
- Redirect loop ( ERR_TOO_MANY_REDIRECTS )
- Plugin Cannot Be Deactivated/Breaks the Site After Activation
- Uncaught TypeError: $ is not a function” jQuery Error
- Links to Your WordPress Site on Social Media Don’t Include an Image
- Huge Error Log File (debug.log, php_errorlog etc.)
- WordPress PHP Memory Exhausted Error
- Nasty JavaScript Errors in the Browser Console
- Error Establishing Database Connection
- URL’s Not Working with Custom Taxonomies/Post Types
- “Maximum Execution Time of X Seconds Exceeded” Error
- Parse Error: Syntax Error (….. on line 42)
- Edits on Design or Content Not Visible On Your Website
- Corrupted Database Preventing WP Admin User Logins
- You’re Locked Out of Your WordPress Website
- Error When Uploading SVG Files To WordPress
- “Are You Sure You Want to Do This” Error in WordPress
- WP-admin Not Working
- cURL error 28
- File Permission Errors
If there are any WordPress errors that are missing that you’d like to see added to this article, please let us know and we’ll do our best to make it happen!
Other Articles You May Find Useful:
What the Experts Said: Solutions to WordPress Errors Explained
This is where the magic happens. Our experts each talk about a WordPress issue that you might need to fix and equip you with code snippets and pointers to help you end your troubles.
Use the filters below to quickly navigate to a specific WordPress error.
- All
- Max Upload Size
- Stuck in Maintenance Mode
- White Screen
- Not Sending Email
- PHP Version Mismatch
- 504 Error
- Error 500
- HTTP Error Media Upload
- REST API
- 404 Error
- Connection Not Private
- Critical Error
- Migration Errors
- Broken Images
- Redirects to Old URL
- Redirect Loop
- Plugin Deactivation
- Uncaught TypeError
- Social Media Image
- Huge Error Log
- PHP Memory Exhausted
- JavaScript Errors
- Database Connection Error
- URLs Custom Posts
- Max Execution Time
- Parse Error: Syntax Error
- Edits Not Visible
- Corrupted Database
- Locked Out
- SVG Files
- Are You Sure...
- Admin Not Working
- cURL Error 28
- File Permissions
Ilene Johnson
Exceeds the Maximum Upload Size for this Site
-
Ideas on How to Solve It – Do ONE of the following to increase the memory limit:
1. Edit the wp-config file and add the following code:
define('WP_MEMORY_LIMIT', '256M');
2. Edit php.ini file and add the following line of code:
memory_limit = 256M ;
3. Edit .htaccess file and add the following line of code:”
php_value memory_limit 256M
Cristina Robinson
Stuck in Maintenance Mode
– “Whenever we update our themes and plugins, WordPress goes into temporary maintenance mode. Sometimes it gets stuck in maintenance mode rendering us unable to access the backend and frontend of our WordPress site. Luckily it’s a simple fix.
-
Ideas on How to Solve It – Access your website via FTP and navigate to the root folder to find the .maintenance file. Once you’ve located that file, delete it. Clear your cache and give your browser a quick refresh.
If you find yourself in this situation often, next time try updating your plugins and themes one at a time.”
Arūnas Liuiza
White Screen of Death
– “This is a situation where Your WordPress site just fails to load and gives you an empty white page instead. It can happen only on the frontend, or it can take the WP Admin console as well. It’s one of the most common WordPress errors people come across.
This usually happens when there is a PHP Fatal error somewhere in your website. It can be caused by a badly uploaded file, a bug in a plugin or a theme, or even by a compatibility issue between them. An upgraded PHP version might be to blame as well.
The annoying thing is that it is impossible to know from the blank white screen what is actually wrong. Unless you have some divine powers, I guess. For us common folks, we need to find a way to debug this issue.
Another frustrating thing is it will not happen in every environment. On your local dev server, you would probably see an error right away. And on some poorly set-up production servers as well. It is the well set-up production servers that are the issue – their administrators usually disable display of PHP errors to the visitors. And that is the correct thing to do, since error messages like that can give away valuable information to people who have less than honourable intentions.
-
Ideas on How to Solve It – There are a couple of ways to debug a situation like this. One is to check PHP error logs on the server. Your server control panel (Plesk, cPanel, etc.) usually has a place to read logs, or if you have good SSH access, they can be found via terminal as well.
If you do not have access to server logs, it is possible to enable the WordPress internal debug log. Go into the wp-config.php file of your WordPress site and add the following lines:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', 'wp-content/wp-errors.log' ); define( 'WP_DEBUG_DISPLAY', false );
This will tell WordPress to enable the debug log, where to put it, and to not show errors to the visitors.
Now when we have some way of looking at logs, it’s time to find the real culprit. Look for lines with the words ‘Fatal error’ in them – those are the root of your problems. On the same line PHP usually references the offending file, with its full path. From that, you can see what plugin or theme the error is originating from, and, of course, a lot more details about what the particular problem is.
The first solution is to disable the offending plugin or theme. You can do that via SSH/FTP/File manager in your hosting control panel. Just go in and rename the directory. I.e. If `my-cool-plugin` is causing the problem, rename it to `my-cool-plugin-broken` or something like it. This will make the site load, at the very least. Some functionality might be missing (in case of a plugin), or it can revert to the WordPress default theme, twenty-something (in case of a theme), but at least the site is unstuck and loads something. You might need to repeat this several times, if for instance, a new PHP version is causing compatibility issues with several plugins.
The next step is to fix the actual issue. And this depends a lot on what the error log says. You might need to update your plugin or theme, find an alternative one, or fix your own code if the issue is with something that you developed yourself. But that’s a whole other topic!”
Scott Kindred
WordPress Website Not Sending Email
– “Your new WordPress site is up and running but you discover that it is not sending email. Most commonly, the problem encountered is that your contact form is not sending its email notifications to you. Other form notifications that you would like to be sent to you, such as a call to action form in a sales funnel, and form entry confirmations sent to your website visitors, can also be impacted by this problem.
The problem usually centers around WordPress’ native email programming that uses the PHP mail() function. This function is increasingly blocked by email service providers like Gmail and Office365; their spam prevention measures. Relying on the native email function often means email that is sent out from your WordPress website may not make it into the recipient’s inbox or even their spam folder.
-
Ideas on How to Solve It – Use an SMTP Plugin.
I recommend three of the top plugins, each of which facilitates the use of a third-party email service like Mailgun or Sendinblue. The SMPTP plugin bypasses the native WordPress PHP mail() function and routes outbound email using proper authentication. This results in reliable email deliverability.
1.WP Mail SMTP by WPForms. Choose the SMPTP services best suited for your needs:
SMTP.com
Sendinblue SMTP
Mailgun SMTP
SendGrid SMTP
Gmail SMTP
Microsoft SMTP (Outlook.com and Office 365) [Pro]
Amazon SES SMTP [Pro]
Zoho Mail SMTP [Pro]
All other SMTP2.Mailgun plugin for WordPress. Specific use with the Mailgun SMPTP service.
Mailgun has a free account that lets you send up to 200 emails per day.
3.Sendinblue plugin for WordPress
Up to 300 emails sent per day for free.
Use these great solutions to make sure both you and your website visitors are receiving email from your website.”
Scott Bothel
PHP Version Mismatch
– “As the speed of progress and the age of WordPress start to collide, it is becoming more common to find a mismatch between your WordPress install and the version of PHP being run on your server. It is not uncommon to find older shared hosting configurations still running PHP 5.4, which was released 8 years ago. With the latest versions of WordPress, there will be an alert on the dashboard when your PHP version needs to be updated. Be sure to backup your current environment and run all available WordPress updates for the platform itself, themes, and plugins.
-
Ideas on How to Solve It – Standard cPanel hosting accounts should provide you with access to changing the PHP version for your account or a specific folder. If you do not have this access, be sure to contact your WordPress hosting provider.
After changing the php version, be sure to refresh your website to see if the notice goes away. It is also possible that you might encounter the white screen of death at this point if you are running an outdated theme or plugin that conflicts with newer versions of PHP. Be sure to follow the troubleshooting steps for that problem next!”
Natalie Famula
Connection is Timing Out (504 Error)
– “When you are experiencing a 504 error, there could be a few culprits. This WordPress error occurs when your server does not receive a response quickly when it attempts to load the page.
-
Ideas on How to Solve It – If you are on a shared hosting plan, you may need to upgrade. This could be a result of another site overloading the server, which is why the connection timed out when trying to access your own site. Contact your hosting provider to see if this is the issue.
Unfortunately, this error could be the result of a hack. Check your firewall logs, and if you suspect any suspicious activity contact your hosting services immediately. They will be able to run a scan and help you troubleshoot.
If you see this error frequently, your WordPress site may not be optimized for performance. First, verify this error is occurring for other users and on other devices. Next, ensure the database is optimized. If the database looks good, then deactivate any plugins one by one to see if one of them is the culprit. The next step is to check that the .htaccess file is set up as expected and nothing has caused any changes here.
If you have a custom theme, take a closer look at your theme files. Identify any opportunities for optimization. This can be a time-consuming process, so try to rule out any simpler causes first.”
Lisa Rees
Internal Server Error (500)
– “One of the most common WordPress errors that I get asked to fix is the 500 Internal server error and as it makes your site inaccessible it sends most people into a blind panic! The error doesn’t actually mean anything specific. All it means is that something has gone wrong but it’s not sure what. 80-90% of the time this issue on a WordPress site is due to a plugin conflict, so you’ve probably just added a plugin or done some updates. The good news is that it’s one of the easier-to-fix WordPress errors, but it will require you to have access to your hosting control panel or FTP.
-
Ideas on How to Solve It – Plugin conflicts are often to blame when it comes to an internal server error. If you are using your hosting’s control panel then you need to navigate to file manager (the instructions are then the same after that for FTP also). Open your site’s main folder (usually public_html) and then open the folder called wp-content. What you need to do now is rename the plugin folder (I normally just put a 1 or off at the end so plugins1 or pluginsoff). Once you have renamed the folder try and reload your website.
If it loads then login and navigate to the plugins page. You will notice all the plugins are unavailable. Go back to your cPanel or FTP and change the name of the plugins folder back to plugins and refresh the plugins page in WordPress.
Now visit your updates page and check to see if you have a load of WordPress updates pending (as if you haven’t updated the site for a very long time plugins can be out of date and not function properly).
You will now need to test each plugin; reactivate them one by one to see which one was the culprit. If you turn one on and get the error 500 again then you know that it’s the plugin causing the issue. You will then need to repeat the above steps with cPanel or FTP but leave that plugin deactivated. It may be that the plugin needs an update or you may need to use an alternative plugin if it’s essential to your site.
If your site doesn’t come back on after turning plugins off also try renaming the theme folder (which would be an error with your theme if it comes back on) or check the .htaccess file in your sites main folder (if you can’t see it you may have to enable hidden files). You may need to check with your web host what needs to be included but if you feel confident enough to change the file, copy and paste everything from the .htaccess file into a text document and replace with:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
Then see if that solves your internal server error. Any additional text in the .htaccess file will probably have been added by plugins so you will need to add it back section by section, noticing if it turns the site back off again.
Another tip to remember when dealing with an internal server error is to always have backups of your site (you can use the Updraft Plus backup plugin, which is free) as if there is an issue you can always roll the site back to when you last noticed it was working. Backups are normally kept for a maximum of two weeks, so I always recommend checking your WordPress site at least once a week for any issues.”
Jithin Mathew
HTTP Error During Media Upload
– “This is one of the more common WordPress errors you might have faced. The most common cause of this error is the server resources. There might be a couple of reasons for this which I’m going to talk you through below.
-
Ideas on How to Solve It – If the site has been working fine and then suddenly you find this issue, the most likely cause is running out of disk space on the server. Check your hosting and make sure you have enough space for storing the files on the server. Make sure you have at least 150MB of free space.
Another possible cause might be the image dimensions. Let’s say you are trying to upload a high-resolution image (4500x4500px), you may run into this error. The best solution is to downsize the image and upload the recommended dimensions. (Some themes and plugins require images to be within certain dimensions for ideal outputs)
Another culprit that could trigger this error is the Memory Limit. If you are on a shared hosting or a resource thirsty hosting, the RAM available to process the image might be less than what’s needed. To fix this error, try adding this code to your wp_config.php to increase the php memory limit:
define( 'WP_MEMORY_LIMIT', '256M' );
You can also set this value from your hosting control panel (if enabled), or using .htaccess file by adding the line:
php_value memory_limit 256M
Or by editing the php.ini or user.ini file by adding / updating the line :
memory_limit = 256M
With this, we are allotting 256MB of memory for processing the uploads and this should fix it.”
Scott Adrian
Bad connection to your REST API
– “Error: {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}
Oh no! I spent all this time learning how to use the WP REST API. Felt like I was dominating the website like a boss. Then I engage my respective function and my request returns a 404 error. What!?
Yeah, I’ve been there almost every time I’ve developed a new site. There are a handful of reasons this happens, and the solutions are all pretty simple.
First off why are we using the REST API at all? Why not just stick to our handy WP_AJAX? Stick to what you know works, right?
Great question! I’d sum up the reason to switch to the REST API in these 3 points:
- You don’t need two separate functions for admin/front-end calls.
- WordPress provides a lot of OOTB endpoints so you usually don’t need to make your own.
- Your site data can now be accessed outside of WordPress by other apps/sites!
-
Ideas on How to Solve It – So back to our error. You got the courage to put your WP_AJAX functions to bed. You registered your rest route or are trying to access core endpoints. You get a 404 error response! Here are some reasons why this happens.
Reason 1:
You’re accessing the rest route OUTSIDE of your website without the proper authentication!
Solution:
This one can get tricky. All outside POST/DELETE calls / Custom rest routes require your headers to include Basic Authorization.
Here’s what that looks like:
Authorization: Basic {base64_encode(username:password)}
You can use an administrator username and password, but I’ve run into issues with this OOTB authorization. When the authorization just doesn’t seem to be working even with the proper header, sometimes I turn to this great plugin:
https://github.com/WP-API/Basic-Auth
Turn it on and the requests magically work. This plugin does require the sites to be on SSL to make sure your calls are safe though, so if you’re not sure where the request is coming from I’d try the next one.
Another great tool, which allows you to not need an actual user account to make the call is:
https://wordpress.org/plugins/application-passwords/
This allows you to register apps for your site instead of using user accounts to make the REST calls. It even allows you to develop a page for outside devs to register an app to use your API.
Authorization can be tricky so I suggest getting Postman to make testing your calls easier.
Reason 2:
Whoops! My path is wrong 🙁
Solution:
We’ve all been there. 3am, can’t stop programming, and now nothing is working. Get some sleep and check your rest route path in the morning.
When it comes to custom rest routes, the path can be complicated to the naked eye. Mainly due to the fact that there are two parts to your path that are defined by you.
Here is an example of a custom rest route I made:
register_rest_route('orbemorder/v1', '/area/(?P[a-zA-Z0-9-]+)', [ 'methods' => 'GET', 'callback' => [$this, 'getOrbemArea'], ]);
The namespace is that first parameter, THEN you have the route.
Now you’ll notice all those random characters wrapping the “position” argument. If you have those even slightly off you’re in trouble. My example is looking to receive a “string”.
If you were receiving an “integer” it would look like this:
(?Pd+)
If I was going to hit my custom rest route the path would look like this:
https://${wpThemeURL}/wp-json/orbemorder/v1/area/${position}
Where the “wpThemeURL” is your site url and “position” is a string.
You’ll notice “wp-json” in the path. That lets the request know it’s accessing your site’s REST API. The namespace comes first after that, THEN the route is after.
Get your path right and you should be golden.
Reason 3:
You’re using the wrong method!
Solution:
If you’re using a OOTB REST endpoint from WP like /posts/ or /users/ then you need to make sure you’re using the proper request method.
Example:
const xhr = new XMLHttpRequest(); xhr.open( "GET", filehref, true );
The “GET” is the method. If you’re trying to retrieve some post/user content, “GET” is what you want.
If you’re trying to update any of your site’s data then go for “POST”.
If you want to delete a post/user then use the “DELETE” method.
Now if you’re hitting a custom rest route you always need to use “GET” even if your manipulating/deleting data. This is because the request doesn’t know what your callback function is doing so it doesn’t care. It just knows that you’re using a custom rest route.
Conclusion:
The WordPress REST API is powerful. With Gutenberg around we all need to learn A LOT more Javascript these days. Don’t be afraid to make mistakes and fail over and over. And over and over. We’re programmers, it’s what we do.
It only takes one success to allow you to go get coffee and fail again.”
Juan Pineda
Broken Links on Your Website (404 Error)
– “Once your WordPress site has been LIVE for a while, it is not unusual that you discover you have some broken links on it. It’s one of the more common WordPress errors that users face.
Broken links can happen for a variety of reasons. Perhaps you decided to change the format of your permalinks and added the category slug to your posts URL. Or you recategorised your content and some of your posts were moved to a different category. Or you deleted some of your content because you didn’t want to show it anymore. Maybe you had a blog on a subdomain and you moved it to a subfolder on your new website.
The result of all these changes is that the old URLs don’t work anymore.
This shouldn’t be a problem if those old URLs were not used anywhere else. But, most likely, they are already indexed by search engines, so they may show up on the search results page. Maybe you have shared them on your social media posts, or someone else has put backlinks to that content. It could also be that those pages are linked to from other pages within your own website.
You will agree that it won’t be a great experience for your users to try to access your content and end up on a blank page.
But, how can you identify and fix these problems?
-
Ideas on How to Solve It – There is a tool that I’m still using after many years called Xenu. This is a free tool that you can download and scan your site for broken links. I think it has not been updated for years, but it’s still doing the job and it’s very easy to use. It will help you identify both internal and external broken links.
Another free tool that you can download for a similar purpose is Screaming Frog. This one will do a full audit of your website from a technical SEO perspective. So you will identify not only broken links but many other areas where you can improve your onsite SEO.
If you haven’t configured Google Search Console for your website please do so. Google Search Console will give you a lot of valuable information about your website, including data about several WordPress errors. For broken links, you will find a report of pages showing 404 errors in the coverage section.
Once you know what broken links your website contains, it is time to decide what to do with them.
First, ensure that your WordPress theme has a 404 error page. With this, users will see a friendly message rather than a broken page. You can also offer them alternative links so they can continue their journey on your website. More information about this here.
Second, take your list of broken URLs and consider which pages are still valid but have a different URL. For those, if you have access to the content that contains the old link go and update it. For example, your internal pages and social media posts. It is always better to have clean and up to date URLs.
Then, install a REDIRECTION plugin on your WordPress website and create the redirections. For this, you basically add a new entry for each broken page that needs to go to a new URL. So all those users that may click on the old URL via Google or 3rd party websites will end up on your new page.
Lastly, if you removed pages that are still indexed by search engines, you can submit a removal request. You can do this via “Google Search Console” for Google or via “Bing Webmaster Tools” for Bing.
Fixing broken links will help you deliver a better user experience to your visitors. And it will also be beneficial for your SEO.”
Sarah Strait
“Your Connection Is Not Private” SSL Issues
– “Internet users are increasingly concerned about safety and security as they’re browsing, and seeing a warning about an insecure website is sure to turn them away. Don’t miss out on potential business opportunities just because they can’t (or won’t) access your site. If you notice this error, or someone brings it to your attention, it’s not the end of the world but is something you should pay prompt attention to.
Information between the site’s server and the visitor’s browser is transferred via Hypertext Transfer Protocol (HTTP), which by itself isn’t secure. In order to protect the data transferred, such as login or payment information, a certificate known as Secure Socket Layer (SSL) is added to the site. When a site is secured, it’s usually denoted with a tiny padlock and https:// at the beginning of the url, which stands for Hypertext Transfer Protocol Secure (HTTPS).
However, when the visitor’s browser is unable to validate the SSL certificate tied to the website, a notification will pop up to anyone trying to access the site to warn them that it may not be safe. This is what the notification looks like on Google Chrome.
The error message will be slightly different on other browsers, but the overall message is the same to site visitors: NOPE. So, how do you fix this error? Luckily, it’s pretty simple if you know where to look.
-
Ideas on How to Solve It – If you know you have an SSL certificate installed on your site, first check to see if it’s still valid and has not expired. You can check the status of your certificate, as well as the expiration date, by clicking the padlock next to your url. In the example below, you can see that the certificate is valid.
Clicking on “Certificate” pulls up the details, showing the valid dates and more. If the certificate is, in fact, out of date, you would need to update it or contact your hosting provider for assistance.
View a Clean Version
Honestly, this is just good advice any time something funky happens with a site. First, open the site in an incognito window. By using an incognito window, you force your browser to open the site without cache or cookies. If it works on incognito mode, there’s probably an issue with your browser cache or cookies and clearing it should solve the issue…
Try a Different Browser
If you’ve tried the previous step and are still seeing the error, load the page in another browser. If the site works on that browser, try to uninstall and reinstall the browser showing the security issue.
Check Your Time
As odd as it may seem, your computer’s clock may be causing the issue. If your computer has incorrectly synced the time, it could cause your browser to think that the site’s SSL certificate is invalid or expired. If your time or date isn’t correct, go into your computer’s settings and update it, then check your site again.
Fix Mixed-Content Issues
Even if your site is secure, having insecure content could still cause your browser to treat the entire page as insecure. The most common reason is insecure files hosted on other sites that are linked via a non-secure HTTP link. To find the content that’s not secure, plug your url into www.whynopadlock.com. They’ll then give you a report and highlight files on the page that are throwing an insecure error. Once you’ve found the problem, there are a few ways to fix it:
- If possible, upload the file directly to your site instead of linking to it. (Side note: this also keeps people on your site, so it’s an extra win).
- If that doesn’t work, try to find a secure site to link to for the content.
- If these options don’t work for some reason, you may be able to use the SSL Insecure Content Fixer plugin which does most of the work for you.”
Jenn Gardiner
Critical Error on Website
– “When you come across a page on your website that says: “There has been a critical error on your website. Learn more about debugging in WordPress” it can be aggravating and alarming. Most of the time when this happens there is a very small coding error somewhere in the template for that page. Usually, there is a “:” where there should be a “;” somewhere in the template code or a “,” or quote is missing.
-
Ideas on How to Solve It – To fix this, you would log into your website backend, and look at that page to see what template it is using. Then go to the template files and scan that template for irregularities.”
Lucas Benvenuto
WordPress Migration Fails and is Not Working as Expected
– “Have you completed a WordPress migration but your site doesn’t look or is not working as expected? Don’t worry! Below I’m going to provide a series of tips when facing WordPress migration issues and talk about how to solve the most common WordPress errors in this situation.
-
Ideas on How to Solve It – Remember to create a backup before doing anything and have the official documentation at hand.
– The site does not look right (style) and/or some images are missing: Chances are some files have been lost during the process. Try to use your server file backup if possible, or use the file administrator to access them (remember to compress the files before download). Hosting provider support can help you with this.
– Links do not work/redirect problems: This WordPress error usually occurs due to a discrepancy between the new domain and the old one. To solve it, you can use this wizard; just execute the MySQL obtained in your database. You can also use this other tool in case the database has serialized objects. Remember, file export can be done via phpMyAdmin or using the terminal.
– Only the homepage works: If you have taken the previous step into account and the problem persists, try to refresh the permalinks and regenerate the .htaccess file.
– SSL certificate problems: Maybe your certificate is still pointing to the previous domain. Reinstall it, and configure it again. With the vast majority of hosting providers, they can help you do this via support. If you get mixed content errors in WordPress, it means that some part of your site continues to point to unencrypted domains. It can be a plugin, embedded content, or something else. The browser console can be very helpful to inspect and solve this issue. If you want to learn more, navigate to the following link.
– Other problems: You can run into a wide variety of WordPress errors depending on the characteristics of the new server and the architecture of your site. Some of these include a 500 internal server error, white screen of death, establishing a database connection error, among others. This article covers a wide variety of them and it might also be helpful to visit the official documentation.”
Sherry Holub
Broken Images in Media Gallery
– “The images on your WordPress website suddenly all appear broken. In a blind panic, you log in and find they’re all broken in the media library as well. What happened? Take a deep breath and try not to freak out. It’s highly likely you’re images are all still perfectly fine in your uploads folder.
-
Ideas on How to Solve It – The very first thing you want to do is make a note of any recent thing you did on the site as this type of error often happens after something was updated.
Plugin/Theme Updates
Did you install a new plugin? If you haven’t installed a new plugin, did you maybe update a plugin recently (or if you’ve set your site to enable auto updates – was one or more recently updated)? If you know for sure a specific plugin was updated before you noticed the broken images, disable that plugin and check if the images have come back. If they have, that plugin is having a conflict with another plugin or your theme.
In these cases, you can reach out to the plugin developer, or try to find another plugin with the same functionality you need. If you don’t have a specific plugin earmarked to check, you can disable all plugins, then enable them one by one and check the media library after each one is activated. If you don’t find a plugin conflict, that is most likely not the issue and you can move on to trying the next thing.
Side note: you can also do the same thing with themes – install a basic theme such as the default WordPress theme and check the media library again. If that fixes the issue, then it’s most likely an issue with the theme that you will need to contact the theme developer to fix.
.htaccess File
Try opening the URL for one of the broken images in a new browser window. If it doesn’t load, you may have a corrupt or rogue “.htaccess” file. I won’t get into all the ways that can happen, but the fix requires that you have FTP/SFTP access to your hosting server and an FTP program, such as Filezilla. The .htaccess file is typically in the main directory. Rename it htaccess.txt. Clear your browser cache and check again and see if this solved the issue. If it didn’t, also check in the wp-content/uploads and see if there is a hidden .htaccess file there and if you find one, follow the same procedure.
File Permissions on Uploads Folder Were Changed
If the problem persists, it could be that the file permissions on the uploads folder on the hosting server were somehow changed. You’ll need to log back into your FTP program and check out the uploads folder again. Check with your FTP software documentation on where to find the “file permissions” (for a crash course in WordPress file permissions, check this post). You’ll want to make sure the uploads folder and all directories inside of it have the permission of 755. Next make sure all files within the directories are set to 644. Afterwards, check the media library and see if that was the fix.
Uploads Folder Structure
One of the other common WordPress errors I see that will lead to broken or “blank” images in the media gallery is changing the uploads folder structure in the Settings > Media. There is a checkbox at the bottom of that page for “Organize my uploads into month- and year-based folders”. Typically, it’s checked off. If you uncheck that box, all the images previously updated will not show up properly in your media library. You want to keep that the same as it was when you originally set up your site.
This of course is not an exhaustive list of every possible scenario – just the “biggies” when it comes to broken images in the WordPress media library.”
Paul Portelli
WordPress redirecting to Old URL When an Installation is Migrated to a New Host or a Completely New URL
– “It’s common that when you move a WordPress installation from one host or URL to another, you end up in a situation where visiting the new URL takes you back to the old URL used, even though you are sure that all the files and the database dump have been properly placed and set up.
-
Ideas on How to Solve It – These are the things you need to be checking.
1. Check Your Options Table: Ensure that both ‘siteurl’ and ‘home’ options are set to the new URL in the WordPress options table. This is usually called ‘wp_options’ but, it’s also quite common for the ‘wp_’ prefix to be replaced with some random characters. In modern WordPress installations, the ‘siteurl’ and ‘home’ options are the very first two options you’ll see when loading the options table with an ‘option_id’ of ‘1’ and ‘2’, respectively. While there, also make sure that both URL values don’t include a trailing ‘/’. This won’t actually affect the redirect but, it’s a good practice to avoid other issues.
2. Check the ‘wp-config.php’ File: The two options mentioned in the first point can be overriden by defining a ‘WP_HOME’ and/or a ‘WP_SITEURL’ constant in the ‘wp-config.php’ file. This below is an example of what you should be looking for:
define( 'WP_HOME', 'https://www.yoursite.com' ); define( 'WP_SITEURL', 'https://www.yoursite.com' );
If both or any one of these lines of code are present in your wp-config.php file, you can either replace the value assigned or remove the lines altogether so WordPress can take these settings directly from the ‘wp_options’ table.
3. Clear Both Server and Local Browser Cache: If your WordPress installation has plugins installed to manage cache, ensure that such cache is completely cleared. If you cannot manually clear this cache, deactivate the plugin altogether. If you cannot even reach the WordPress backend to deactivate the plugin, you can also log into the server via FTP or access the WordPress installation files through the server’s control panel and rename the plugin’s directory in wp-content/plugins. It is also possible that the Internet Browser on your computer is caching the redirect so, in this case, you can either try to navigate to the new URL using an Incognito or a Private window or use a different Internet Browser altogether. Every modern browser allows you to clear its cache.
4. If All of the Above Fails: If none of the 3 options above work, the issue is most probably happening inside a custom plugin or some other custom code in your active theme. To determine if the source of the issue is a plugin, you can deactivate all plugins installed (as instructed in point number 3). If this doesn’t work, try deactivating the active theme. There are various ways how you can do this, even if you can’t access the admin area of your WordPress website. A simple ‘manually deactivate WordPress theme’ Google search will help.”
Ali Khallad
Redirect loop ( ERR_TOO_MANY_REDIRECTS )
– “A redirect loop is when your website continues redirecting back and forth between two pages or more, which results in an infinite loop, thus, a browser error “eg; ERR_TOO_MANY_REDIRECTS”. The redirect loop issue usually occurs due to a misconfiguration or wrong implementation of WordPress redirects, either programmatically or using a plugin.
-
Ideas on How to Solve It – They say that “Understanding the problem is half the solution”. There are a number of different root causes of the redirect loop issue, which also means several different possible solutions. However, if you’re able to narrow down the possible cause, you’ll easily figure out how to fix the issue. This is a list of the steps you’d want to take to determine the problem:
Cache & Cookies:
The first step when testing is to clear both site and browser cache, clear cookies and disable site/host caching..htaccess Modifications:
Some modifications to the “.htaccess” file might cause the infinite loop problem. Thus, a regeneration of this file might be enough to fix the issue. Take a back-up of “.htaccess”, remove it and follow these steps to regenerate it:– Head to “Admin dashboard” -> “Settings” -> “Permalinks” then click “Save changes” without making any actual changes.
Plugins:
Many plugins force specific redirections, which results in the redirect loop in some cases. To test plugins, disable any redirection plugins and if this didn’t work, disable all plugins one by one and test until all of them are disabled.
HTTPS:
In many cases, the redirect loop is caused when the site keeps redirecting between “http” and “https”, mostly due to the site not having an SSL certificate. To fix this issue you need to first make sure you have a valid SSL certificate, then change your site settings to load over “https”. You can use plugins such as Really Simple SSL to help you force HTTPS.
Third-Party Services:
Reverse-proxy services are another possible cause of an infinite loop. Services such as Cloudflare implement their own SSL, which can cause some conflict with your own implementation.
Finally, to conclude, redirect loops can be tricky to track and solve. The steps above will help you to determine the cause of this error, and in most cases will lead to you resolving the issue. However, sometimes you’ll need to do extra work to get it sorted, but at least you know where to start.”
Ionut Calara
Plugin Cannot Be Deactivated/Breaks the Site After Activation
– “When the site gets broken by a plugin you will see an error message like this one:
-
Ideas on How to Solve It – You need to have the debugging turned on, otherwise you will not see the errors. So to check what happened you will first need to enable debugging and look at the logs. If you see an error originating from a plugin then you need to disable that plugin.
Since the admin is no longer working, you cannot disable the plugin via the admin.
Luckily the standard plugin activator will not allow you to install/update a plugin if has a fatal error. You will get an error message like this one:
However, if you used a third-party plugin that you manually updated or you used a third party plugin manager you might still find yourself with a broken site.
To fix the issue, you will need to go into your website files via FTP or SSH, and go to the plugins folder under `/yoursiterootfolder/wp-content/plugins`
Once you are there, locate the problematic plugin, and rename the folder by adding a number at the end for example `akismet-2`. This will restore the website and you can go inside the admin section to delete the plugin.”
Mykolas Raižys
Uncaught TypeError: $ is not a function” jQuery Error
– “There are times where you may need to add a custom JavaScript snippet to your site. For example, to enable some interaction of some element or enable a third-party service. There are numerous ways to do it, including some snippet plugins.
However, oftentimes the code does not work even after following all the instructions and copy-pasting the code and it results in the following error in your browser console:
Uncaught TypeError: $ is not a function
See, $ is shorthand for jQuery and your code is most likely using that. Thankfully, jQuery is included in WordPress by default, which enables you to use the shorthand. However, to make it work, you need to wrap your code in a correct function.
-
Ideas on How to Solve It – The way to fix the issue is to wrap it with either one of these functions:
(function($) { //Your Code Here })( jQuery );
or…
jQuery(document).ready(function( $ ) { //Your Code Here });
There is no big difference in terms of which one you use. However, if your code needs to run after the HTML content is loaded on the page, the latter is the better option.”
Eileen Mullin
Links to Your WordPress Site on Social Media Don’t Include an Image
– “After you’ve worked hard to create a good-looking WordPress site for your client, it’s so satisfying to post about it on Facebook and your other social media networks. It’s a great way to promote both of you – but what if you post it and there’s only text, and no large featured image with your post to draw the reader’s attention?
-
Ideas on How to Solve It – Before sharing your post, take a quick visit to FaceBook’s Sharing Debugger page. Enter the Web address for the new site, and this page for developers will show you if there’s an image that will appear with your post. If you don’t see an image, there will be a message that “og:image” is missing. No worries – you can take care of this and then ask FaceBook’s Sharing Debugger to scrape the site again.
An easy way to add an og:image and the rest of the Open Graph meta tags used by Facebook is to install the free Yoast SEO plug-in. Once installed, scroll down and click on SEO, then Social in the left-hand navigation. When the SEO settings expand, click on Social, then the Facebook tab. Here, you can add a default image for pages that do not have any images. If your home page displays posts instead of a page, you can set the home page Open Graph tags here, as well. Be sure to save your settings.
Next, revisit the Sharing Debugger page. Click the “Scrape again” button and this time, you should see your image display. Yay!”
Giannis Kipouros
Huge Error Log File (debug.log, php_errorlog etc.)
– “The Error logs can be powerful tools at a developer’s disposal. Although many times underestimated, they are the first place you should look when debugging your site or to get an idea of your site’s current health.
In particular, the PHP log file stores valuable information about what might be going wrong with the site. This includes but is not limited to PHP code Warnings, Errors, and Notices.
So if this log file is so helpful, why can it be a problem?
The problem is that sometimes this file can get huge, without the site’s owners noticing. This causes the site to slow down gradually and can even reach a point where it can make the site stop functioning.
-
Ideas on How to Solve It – I see that my site’s error log is huge! What can I do? If that is the case, do not worry! There are steps that can help you sort this out:
- First, download a copy of the log file to your computer.
- Rename the log file on your site, so it instantly stops writing to the huge log file and creates a new one. This will give your site an immediate boost, but it is a temporary fix.
- Then, you will have to determine what is causing the error log to get so huge. What better place to start looking for the causes than the log file itself? Open it using an editor* and look at the newest entries. They should help you determine what is causing them and try to fix it.
- Most of the times, the causes of log file entries are outdated themes and plugins. Updating them should help fix most of the issues and avoid any new log file entries.
- After fixing all WordPress errors that cause the log file entries, it might be a good idea to disable the log file from the production site. Of course, you can re-enable it when debugging is needed. To disable the log file, you add the following to the wp-config.php file in your site’s root directory:
define('WP_DEBUG_LOG', false);
* Note: The log files can be very big, and text editors might not be able to open them. If that is the case, there are applications specifically for this job. The one I use is free and is called Glogg.”
Milan Petrovic
WordPress PHP Memory Exhausted Error
– “One of the most common WordPress errors is the ‘PHP Memory Exhausted Error.’ And while the immediate fix might be simple, in my opinion, the problem with this error is that it usually points to some underlying issue that needs fixing. The webserver runs PHP, and PHP is used to execute WordPress, and PHP limits the amount of memory assigned to each process. Usually, that memory limit is 32MB, but it will differ depending on the hosting company. Most hosting companies allow you to change this value, but some might have a hard ceiling limit or completely lock-out this value from user changes.
Depending on what plugins and theme your website uses, it will require a different amount of memory. It would be best to have PHP memory limit set to 64MB for general purpose websites or 128MB for an eCommerce website running many plugins and addons. In more extreme cases, you might need to increase the memory limit to 256MB or even more, but in my opinion, anything above 128MB points to some serious issue with your website needing so much memory for a single process.
-
Ideas on How to Solve It – The best way to change PHP allocated memory is to make the change directly in PHP settings (php.ini file, look for an option called ‘memory_limit’), but nowadays, most hosting companies offer more straightforward ways to do it via a control panel so ask your hosting provider first.
You can also change increase the allowed memory size via WordPress’s wp-config.php file. Upgrading PHP to 7.0 or newer with OPCache enabled is highly recommended because it will require much less memory to run.
If you see the PHP memory exhausted error, tried to allocate more memory, and still keep running into the issue, I would advise in-depth debugging to find out what is using all the memory because you might have a bug that causes endless loops or memory leaks.”
Marius Vetrici
Nasty JavaScript Errors in the Browser Console
– “Many folks we talk to complain that from time to time some features on their website suddenly stop working. These are very subtle yet nasty errors that could eat your WordPress website up from the inside.
Things that could break include:
- the shopping cart
- the checkout
- the contact forms
- any quick quote calculators
- sliders and alike.
-
Ideas on How to Solve It – Diagnosing such a problem is the first step, and to do that, do follow these simple steps:
- Right-click anywhere on the web page
- Click on Inspect
- Click on the Console tab
- You should get this:
- Try the following things to fix these WordPress errors.
Potential Fix 1: Update your WordPress installation, themes and plugins to their latest version. But make sure you are not updating them on the live site, but on a copy of your live site (a staging site).
Potential Fix 2: Install the “Enable jQuery Migrate Helper” plugin
Potential Fix 3: If you are using any caching plugins, clear the cache of your website.
Potential Fix 4: If your hosting uses any caching, clear the cache on your hosting.
Potential Fix 5: If you are using a speed optimization plugin, try to temporarily deactivate it.
Lastly, if nothing from above fixes your error, it’s time you contact your developer. So make sure you reach out to your favourite developer and ask for their help.”
Nikola Birisic
Error Establishing Database Connection
– “This is a very common WordPress error especially if you are setting up a new WordPress installation or migrating your website from one host to another.
-
Ideas on How to Solve It – There are usually a few things that can cause an “error establishing a database connection” error such us: incorrect database credentials, server not running, a corrupted database or a corrupted file.
1. Check Your WordPress Database Credentials
In order for WordPress to work it needs to be connected with the database host from which it pulls the data. To connect your website with the database you’ll need to check the following:
- Database name
- Database username
- Database password
- Database server
You can check this information in the WordPress configuration file called wp-config.php
If you’re not sure what your database credentials are, you can check them on your server in cPanel under the Databases section.
When you enter MySQL Databases you’ll find the database name and associated username to that particular database.
Below database name, when you scroll down, you can find database user’s settings where you can change the user’s password.
When it comes to the hostname, in most cases it is set to ‘localhost’ but this can vary depending on the hosting provider you are using. If you still need help, the best thing would be to contact the support of your hosting provider and check with them about all the information you need.
2. Check If Your Server is Running
If you are still having an issue you may want to check if your server is down. This usually happens if you are on shared hosting and the server is experiencing a heavy traffic load that it can’t handle and because of that it may show your user an error.
You can also check this by trying to connect/open phpMyAdmin. If you can’t open it, then the server is probably down and you should contact support.
If you can connect, but still the error occurs, check if the username has sufficient permissions. You’ll need to create a file, for example dbtest.php (but you can call it however you want) and add the following code:
/** * Check my database connection */ $db_test = mysqli_connect('localhost', 'db_user', 'db_password'); if (!$db_test) { die('Database Error: ' . mysqli_error()); } echo 'Database connection is working properly!'; mysqli_close($db_test);
Be sure to change the dummy info to your database username and password.
Then in your browser go to https://yourdomain.com/dbtest.php (or whatever you named the file) and if the message displayed reads “Database connection is working properly!” that means that WordPress is connected to the database and that the user has sufficient permissions. In the event that you are still getting an error, go and recheck your database credentials in the wp-config.php file (check for any misspelling or mistakes).
3. Repair Corrupted Database
You can also come across the situation where the database is corrupted. For example, if you log in to your WordPress dashboard and you’re getting an error such us: “One or more database tables are unavailable. The database may need to be repaired.” In this case, you need to repair the database. This could happen due to constantly removing and adding new plugins and/or themes that are adding/removing new tables to or from the database.
But don’t despair, WordPress has a database repair mode that you can initiate by adding the following:
define(‘WP_ALLOW_REPAIR’, true); /* That’s all, stop editing! Happy blogging. */
Again, add this to the wp-config.php file, just above the line “That’s all, stop editing! Happy blogging.”
Then in your browser go to the following location https://yourdomain.com/wp-admin/maint/repair.php and it will take you to the following:
Another way to repair it is through phpMyAdmin. Check all the tables and select Repair table, as in the example down below.
4. Repair Corrupted File
Another reason you might see the “error establishing a database connection” message is because of a corrupted file, although this is not common. This may occur if somebody hacks your website and makes changes to some files, either WordPress core files or some plugin files. Or it can happen due to some issues/errors while transferring files via FTP.
If this is the case, check if any files have been changed/modified recently. If you notice they have, do a fresh install of the WP core files or the plugin, depending on which file has been affected.
And that’s it. You’re now ready to deal with one of the most common WordPress errors and ensure your site has no problems with establishing a database connection!”
Carlos Alvarez
URL’s Not Working with Custom Taxonomies/Post Types
– “So you create a new post type or a new taxonomy (either using a plugin or by code), then you create a post (or category) belonging to that post type (or taxonomy), you finish your work in the editor and proceed to see the results in the browser. What happens next? Yes, you see the annoying 404 error page and you don’t know why.
Let’s see this issue with pictures!:
So I created a new post type called ‘Experts’ and created a new ‘Expert’ post:
And you can see I set a nice permalink for this post, so when I go to that URL in the browser I see this:
-
Ideas on How to Solve It – The reason this happens is because WordPress doesn’t know what to show when http://experts.test/expert/test-expert/ comes in. How can we make WordPress recognise this? The answer: By generating a Rewrite Rule.
A rewrite rule is basically a rule that tells the WordPress system what content to show when a certain URL is used. WordPress comes with default rewrite rules to show normal posts, pages and post category archives but not for other post types or categories that are not in the ‘category’ taxonomy.
In our example, the URL has this structure: domain/post type name/post name. The problem is that WordPress doesn’t know that ‘expert’ is a post type (YET!). How can we make WordPress understand this? Yes, you guessed well, we need to generate a rewrite rule for the ‘experts’ post type. The easiest way to accomplish this is by updating the permalinks structure. When this happens, WordPress also regenerates all the rewrite rules needed for the system to work properly, including the rules for the newly created post type (or taxonomy). To update the permalinks do this:
1. Inside the dashboard, go to Settings and then to Permalinks:
2. Inside the permalinks page, scroll down and click on the Save Changes button
You should see a notice in the upper part of the page telling you that the permalinks structure has been updated (See the image above).
3. Once you update the permalinks structure and the rewrite has been regenerated, you should see the contents of your post!:
Important Note
If you used PHP code to create the new post type or taxonomy, please make sure that the query_var parameter is set to true, otherwise the solution given here won’t work:”
Pierre Saïkali
“Maximum Execution Time of X Seconds Exceeded” Error
– “Depending on the page you’re visiting and your hosting capacity, you may receive this error message. If the page is taking too long for a process to complete, it will result in a timeout and you’ll see this error message.
-
Ideas on How to Solve It – To fix this issue, we need to change a PHP configuration variable called “max_execution_time”. The value associated with this variable is the maximum number of seconds that the server will spend trying to generate a page.
We have multiple ways to modify this configuration.
1) Edit the `.htaccess` file in your website root folder.
Add the following:
`php_value max_execution_time 300`
2) Edit the `php.ini` file
Add the following:
`max_execution_time = 300`
3) Add…
`set_time_limit(300);`
…at the very top of your `wp-config.php` file.
Using the value 300 means that a page will timeout after 5 minutes (300 seconds).
If you’re not really sure how to edit these files, you should contact your hosting provider and ask them how you can increase the maximum execution time for your website.
If you still encounter timeouts after changing this setting, you may need to investigate deeper and look for the culprit: too many plugins, a demanding CRON job, bugs in your theme, slow hosting provider… A bit of troubleshooting will be necessary in order to discover the cause of this issue.”
Thomas Sultana
Parse Error: Syntax Error (….. on line 42)
– “This can be quite a difficult problem to solve, and may require some programming experience. Firstly let’s define what the error means. You may come across this WordPress error in multiple situations. You may see this error clearly visible in your browser as you view the affected page or website. In other cases you may simply see a white page with no content loaded. This is a sure sign to check your hosting’s website error logs, which will provide more details about the error. The other possibility since WordPress 5.2 is the error is e-mailed to the admin registered email address in the WordPress install.
This particular WordPress error is a PHP syntax error, which means the correct rules were not observed when the code was written. This might sometimes be a simple mistake, like forgetting to add a semicolon. Or possibly forgetting to close or open a bracket.
-
Ideas on How to Solve It – First you will need to find the offending file. From there you will be able to find the offending line. You will know what line the error is on by looking at the error message. Sometimes the line will be shown like this: “on line 278″, however sometimes the line will be shown like this: filename.php:278”. In both cases the error is most probably on line 278.
So why did I say most probably? Certain syntax errors won’t provide you with the exact line an issue occurred, but rather the line that is close enough to the error. So if you can not see an error on the exact line, try to scan code a few lines up or down. Also, look if there is any missing opening or closing brackets around that line. A good IDE (Integrated Development Environment) will be vital in helping you solve this issue.
So what if the error is inside a plugin or theme which you have installed? In this case, it would be suggested to contact the plugin/theme author about the issue. Hopefully they will be able to provide a quick plugin/theme update which you will be able to download. You can always fix the error and inform the plugin/theme author of the exact fix you made.”
Matt Bonacini
Edits on Design or Content Not Visible On Your Website
– “You edited your WordPress widgets, page contents (or design), or even the main theme’s files. Still, you don’t see any edit on your public website and see its old version instead.
What makes things worse is that you don’t see any clear error message, making it even harder to know what’s happening.
Not seeing your edits immediately may convince you to apply further modifications to your site, which can lead to small disasters or unexpected changes to your design, especially if you don’t see what effects the modifications have on your site.
This may also happen when you hire a developer to make specific edits on your site. He’s claiming that he made all the edits required, but you can’t see them.
-
Ideas on How to Solve It – No worries, fixing this is pretty straightforward. You can try the following steps in this exact order.
Step 1: Force your browser to hard refresh your page. While you’re on any of your site’s pages, you can try to refresh with CTRL + F5.
If you’re on Mac, you can try to hold ⌘ Cmd + ⇧ Shift key and then press R.
Step 2: Search for any active caching or performance optimization plugin on your installation. Login into your WordPress admin area and check your Plugins list. If you have any plugin that improves your site’s performance and loading time, you can try to clear all forms of cache from this plugin’s settings. All the popular plugins in this category, like WP Rocket, W3 Total Cache, WP Super Cache (etc.), should all have a way to clear all the cached files.
Step 3: If you tried everything before this step, and your changes still don’t show up, there’s one final place you can check: your hosting service. Many hosting services, often without advertising it, have some sort of caching system active. Sometimes these are clearly visible in your hosting dashboard; sometimes, they’re more hidden in their interface.
If you’re not sure where to find an option to clear your server-side cache, you can contact the support of your hosting provider who can tell you where to find it.
At this point, you should see all your edits on the public version of your website as well. Hopefully, applying these steps will simplify your work the next time this happens. If you want to make your life even easier when working on your site, make sure to disable all caching options: on your website and on your hosting service.”
Marc McDougall
Corrupted Database Preventing WP Admin User Logins
– “Although uncommon, it’s SUPER frustrating when you get locked out of your WP Admin area.
This can happen for a few reasons:
- A malicious attack on your database from a 3rd party.
- A plugin or theme change corrupted your database.
- You just forgot your password and don’t have access to the admin email (this happens, yes 😂)
If you run into this issue, your first line of defense is always to contact your hosting provider to see if they’ll help you out.
BUT…what if they can’t help you?
Or…what if you don’t have access to a hosting provider because you’re hosting your site locally while you build it?
-
Ideas on How to Solve It – If all else fails, you can always manually reset the password to your WP Admin account.
NOTE: This solution is pretty advanced, so only use it as a last resort!
NOTE: This solution also requires that you have access to the SQL database associated with your site (usually through a tool like PHPMyAdmin).
Step 1: Login to PHPMyAdmin and find the “wp_users” table…
After clicking on the “Browse” tab, you’ll see your old admin login.
We’re going to be adding another one that you’ll then use to get back into your site!
Step 2: Create your new password (and hash)…
WordPress doesn’t store passwords in plain text (for security reasons), so you’ll need to hash your password before dropping it into the database.
Go to a site like https://www.md5hashgenerator.com/, and type in the password you want to use in the big text box.
After you click “Generate”, you’ll be given a long string of characters — this is your password hash. Save this for later (and remember the plain-text version, too!)
Step 3: Create your new user…
Now you need to create your new user account.
Back in the wp_users table, click “Insert” at the top and type in the user_login, user_pass, user_email, and display_name values.
NOTE: You want to enter that password HASH into the “user_pass” field, not the plain-text version.
When you’re done, click “Go”
Congrats! You now have a new user that you can use to login to your site.
Now, we have to give that user administrator privileges.
Step 4: Granting administrator privileges…
First, take a note of the “ID” value for the new user you just created.
You’ll need this later.
Next, navigate to the “wp_usermeta” table, and click on the “Insert” tab here.
You’re going to enter a few fields here:
- user_id : Enter the ID you wrote down from the last screen.
- meta_key: Enter→ wp_capabilities
- meta_value: Enter this exact string→ a:1:{s:13:”administrator”;b:1;}
Click “Go” at the bottom of the screen.
Next, you want to repeat this process, but for a different meta_value:
- user_id : Enter the ID you wrote down from the last screen.
- meta_key: Enter→ wp_user_level
- meta_value: Enter→ 10
Again, click “Go” at the bottom of the screen.
Here’s both those queries if you want to double-check everything:
Step 5: Checking that it all worked.
Go ahead and log in to your WordPress site again (usually by going to “[YOUR_DOMAIN]/wp-admin”).
This time, you want to use the new user login credentials and the PLAIN TEXT version of the password you used to generate that hash earlier.
Finally, click login.
…and viola! You should be back in business!
Check the Users pane in WordPress to confirm that everything worked:
Getting locked out of your WordPress site can be a HUGE pain.
I hope this helped you get back in, without too much hassle.”
Nikola Petrov
You’re Locked Out of Your WordPress Website
– “One of the most frustrating experiences a user can have is being locked out of their WordPress website. You have spent weeks or months building the best content you can, and one day, out-of-the-blue, you are no longer able to access or even see it. To make things worse, WordPress does not always show error messages when you are locked out of your website, so you might have no clue why this is happening to you.
-
Ideas on How to Solve It – In the following lines, we will summarize the most common causes of being locked out of your website and how to solve them using techniques from our practice and experience.
The White Screen of Death
Check this contribution for info about this.
Error Establishing Database Connection
Check this contribution for info about this.
An Incorrect Password
Is WordPress telling you that you are locked out because you have entered an incorrect password? This happens because for security reasons the platform allows only a limited number of wrong login attempts (three to be exact) and you have used them all.
How Can You Fix It?
Click the “Lost your password” link on the login page. WordPress will send you an email, where you can reset your credentials. Alternatively, you can reset your password yourself using phpMyAdmin.
If you are still not able to access your website, it is possible that you have been hacked. You can try running a malware scanner and cleaner, or you can contact a trusted developer to help you with the clean-up.
A Corrupt Theme or Plugin
Sometimes, it is possible that a corrupt theme or plugin will cause a WordPress error that can lock you out of your admin area.
How Can You Fix It?
You can try temporarily disabling all plugins by accessing your website files via FTP and renaming your wp-content/plugins folder to deactivate all plugins. If that fixes the issue, you can start re-enabling them again one-by-one (by renaming back your plugins folder to its original name and activating them in admin), until you figure out which is the problematic one.
If that doesn’t help, you can try the same for your active theme. Before renaming or deleting it though, please make sure that you have one of the default WordPress themes (Twenty Twenty or another) uploaded.
Incorrect Roles and Capabilities
While working with a Codeable client in the past, I’ve run into a case where all roles and capabilities of users on her website were messed up. As a result, her admin account no longer had admin privileges.
This is an issue that doesn’t have a straight-forward fix, but if you have some basic PHP knowledge, you can try to track down and modify the global $wp_roles in order to regain access.
Hacked
Are you able to log in but things just don’t look right? You might lack some admin privileges, such as being able to access plugins or themes, or your content might look different? Unfortunately, this is often an indicator of being hacked.
How Can You Fix It?
As with the scenario above, your solution depends on how comfortable you are with cleaning your website yourself. If you feel you need help, there are services like Codeable that put you in contact with developers who can make sure your site is completely cleared of malware. After you regain access, make sure you use a high-quality security plugin to ensure that your site is not hacked again.
Parse Error
If you encounter a “parse error: syntax error” message as you attempt to access your site, it means the problem is caused by issues with the code. This is a very common situation as in PHP, small mistakes like a misplaced comma or a single wrong letter, are sufficient to produce an error on page load.
How Can You Fix It?
Using an FTP client, check the recent code you have added to identify any mistakes in the syntax. The error that you have seen on the page should provide you with a clue as to what and where the mistake might be.”
Milenko Radic
Error When Uploading SVG Files To WordPress
– “Very often users want to use an SVG file because it’s one of the best file types for illustrated images. But when you try to upload it to WordPress, what you get is a message that this file type is not permitted for security reasons.
All of you are probably familiar with it:
We all see the problem here, right? An SVG file type is not in the list of supported files in WordPress.
But, hey guys, don’t worry, I‘ve got your back!
-
Ideas on How to Solve It – This issue can be easily fixed in 2 different ways.
1) If you are a developer or you just feel comfortable changing the functions.php file – you can simply insert this code and your problem will be solved:
// allow upload of SVG files function cc_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter('upload_mimes', 'cc_mime_types');
2) In case you would like to fix this problem with a plugin, you can use “SVG support” (and you can find it here).
Ok, I know, I know.
No matter which way you enabled SVG uploads, you can still sometimes get that boring message when you try to upload your SVG file:
So, here comes the Pro tip:
Before uploading an SVG file, I would recommend cleaning your SVG file with this tool:
Just open your SVG file in notepad or a similar basic text editor and then paste your code in the recommended tool and…Voilà!
This will also clean your file from possible scripts that could be embedded and then your new file will be ready for upload.
Easy, right?
How to upload your SVG files to WordPress easily: Case closed!”
Giulio Daprela
“Are You Sure You Want to Do This” Error
– “There can be a few causes for the “Are You Sure You Want to Do This” error in WordPress, but as a general rule it’s important to notice that this error indicates that the nonce verification has failed. Why this might happen is the subject of this short article. Nonce literally means “number only used once” and it’s a security feature used to make sure that only authorized users can make changes to the installation, be that saving a post or modifying a setting.
-
Ideas on How to Solve It – Probably the most common cause of this WordPress error among regular (non-developers) users is when one hits the back button of the browser and then the forward button again. When you hit the back button the nonce of the previous page is invalidated, but when you click forward again the browser re-sends the same nonce and this causes the error.
Another instance where this WordPress error happens is if you leave your post editor open until the day after (if you have children that distract you, you know what I mean!). If you were editing a post and try to save it after one day, you’ll probably get the “Are You Sure You Want to Do This” error. This happened because the nonce in WordPress has a standard duration of one day and when it’s expired you must reload the page.
There’s a third case where this error happens, and this is the most complicated to troubleshoot but also (at least in my experience) definitely less common. It may be that a plugin or a theme uses the nonce incorrectly, and this causes the error. When this happens, FTP becomes an invaluable tool for your troubleshooting efforts, so please download an FTP client if you don’t have one already (FileZilla is a popular one) and make sure to have the FTP credentials to connect to your host.
It’s hard to know in advance whether the problem is caused by a plugin or the theme but I suggest you start investigating the plugins since this is the most probable cause.
Investigating Plugins
The first step in investigating the error is to disable all plugins. The easiest way to do this is to rename the plugins folder inside your WordPress installation. Connect your FTP client, navigate into the wp-content folder, and rename the folder plugins to plugins.disabled. Then, with your browser load the plugins page in your WordPress admin area. You should see a list of errors indicating that the plugins have been disabled. Now, if you can’t replicate the error anymore it’s a sure sign that it was caused by a plugin. Reopen your FTP client and rename the plugins.disabled folder back to plugins. Now you should be able to see the list of all of the plugins again but they are all deactivated. Activate them one by one until you can replicate the error and you’ll have found the cause.
Investigating the Theme
If the plugins are not causing the problem, the next step is to try the theme. Connect your FTP client and delete only the active theme folder (DON’T delete the entire themes folder) that is located under wp-content/themes. Make sure to always have a default theme installed. A default theme is one of the 20xx themes published by the WordPress team every year. If you don’t have one and you can’t install it from your WordPress admin (I’m assuming that your installation is broken and unusable), download one to your PC from wordpress.org, decompress the file and then upload the resulting folder and all of its content to your WordPress installation via FTP. When WordPress won’t find the current theme folder anymore, it will switch automatically to the default theme. If the error now disappears, then it was caused by the theme.
If you still experience the message “Are You Sure You Want to Do This” after disabling plugins and theme, then there’s an issue with the core WordPress installation. Some files are probably corrupt and you should replace your entire core installation with a fresh copy. That is the easiest way since looking for the faulty file manually could take hours. This seems scary at first but if you know what to do it’s quite a simple operation. Again, you’ll need your FTP client to do this. First of all, as preparation work follow these four steps:
- Make a backup of your WordPress installation so you can restore it if something goes wrong
- Download a copy of WordPress from wordpress.org onto your pc and expand the zip file
- Using your FTP client, download the wp-config.php file from your WP installation to your local machine
- Using your FTP client, download the entire folder wp-content to your local machine
Now, delete your entire WordPress installation except the folder wp-content. In case you mistakenly delete it don’t worry, you can restore the copy from your local machine. Once you’ve done that, upload the fresh copy of WordPress that you downloaded from wordpress.org to the host, making sure to NOT upload the wp-content folder. Once you’ve done that, upload the wp-config.php file. Your WordPress installation is refreshed and should be working again.
While I’ve replaced the core WP installation a few times for various reasons (mostly on hacked sites), I must admit that I have never had to go this far to fix the “Are You Sure You Want to Do This” error.”
Zeljko Skipic
WP-admin Not Working
– “This can be extremely annoying, and I will skip the common part of explaining ‘what is wp-admin’ and simple solutions that we all think of right away, and go to the ones that often slip our minds.
-
Ideas on How to Solve It – …Backup your site! Seriously, before anything, back. it. up.
Cookies
Sometimes your browser cookies can cause problems, preventing you from logging in to your (or any other) WordPress site. That’s why it is a good idea to clear cookies from time to time, and it is an extremely easy fix to try, which can save you a ton of time. And it won’t hurt from a privacy standpoint either! Here’s how to do it in Chrome, but it is similar for any browser:Open Chrome, and press CTRL+SHIFT+DELETE at the same time. It will open the “Clear browsing data” window. Tick “Cookies” and “Cache” and click on the “Clear data” button.
.htaccess
Sometimes you will get an unpleasant surprise, and see the vicious “404 not found” displayed after your login attempt. Other times you do manage to log in, but the page just refreshes or redirects; the solution for both WordPress errors is the same. You can either create a new .htaccess file, or update your site URL, or try both. Here is how to do it:– Fixing Broken .htaccess – Through cPanel File Manager or FTP, navigate to the public_html folder, and there find the .htaccess file. Right-click on it, select “Rename” and change its name to something like “.htaccess-off”. We want to make sure that this file is the problem, that’s why we are renaming it first, so we can switch it back to normal if renaming doesn’t fix the issue.
Try to log back to your WordPress site. Worked? Just go to your dashboard, click on Settings, choose Permalinks tab and just hit “Save changes”. That will create a new .htaccess file.
If the fix didn’t work, you can navigate back to cPanel or FTP, and revert the name of the file from “.htaccess-off” back to “.htaccess”.
– Fixing Site URL – To manually fix your site URL, again, go to cPanel/FTP, and navigate to the public_html folder, and find wp-config.php file. Right-click it and select “edit”.
Next, you want to add these two code lines to the wp-config.php file (make sure to enter your real site URL instead of “yoursiteURL”):
define(‘WP_HOME’,’http://yoursiteURL’); define(‘WP_SITEURL’,’http://yoursiteURL’);
Save/upload everything, and check your login page.”
Marcel Brown
cURL error 28
– “One of the more obscure and “interesting” WordPress errors I’ve run into while working with the platform is:
cURL error 28: Operation timed out after X milliseconds with 0 out of 0 bytes received (http_request_failed)
Depending on where you see the error, it may or may not have all the details shown above.
This error may first be noticed in the Site Health Check section of a WordPress installation with the critical issues “The REST-API encountered and error” or “Your site could not complete a loopback request”. However, you may find this error elsewhere or in your log files.
-
Ideas on How to Solve It – As I mentioned above, this is one of the more obscure WordPress errors and when I say “interesting” I mean that it can be very tricky to resolve! The bottom line is that you will likely need to get your hosting provider involved, or if you run your own hosting server you may need to get down to some lower-level OS troubleshooting.
cURL is a command line tool that is used for transferring data with URLs (hence the name). WordPress uses a PHP library to access cURL. Therefore the first thing to verify is that you are using an up-to-date version of PHP. For most, that means PHP 7.0 at a minimum. At the time of this writing, PHP 8.0 was just very recently released but most installations should be on PHP 7.3.x or 7.4.x.
Other possible simple explanations for a cURL error 28 are issues with DNS resolving or general network connectivity issues. Often these issues are temporary, but they are worth troubleshooting to make sure your host server is functioning properly. Also, a low memory limit set in the WordPress configuration may intermittently cause a cURL error 28. Additionally, sometimes an old plugin can generate this error.
Beyond an out-of-date PHP installation, most cURL problems are related to security issues. In my experience, the most common culprit for generating a cURL error 28 is firewall or security software on the server. If you’ve ruled out the simple issues above, carefully review your firewall or security logs to see if it is blocking cURL from properly communicating. Often it may have something to do with blocking particular PHP calls. Finally, some hosting providers may put limits on wp-cron or they disable loopbacks. This is not very common, but it is good to verify in case you have a unique hosting company or have a server run by a very strict system administrator.”
Nemanja Cimbaljevic
File Permission Errors
– “If you are doing WordPress setups daily, a “File permission error” is something that will not even make you blink, but rather think something along the lines of “How hard is it to set privileges properly?!”
File permission errors can cause numerous errors in WordPress. It might be that you can’t upload any images or documents to the media library. Or you might not be able to install a new plugin or theme.
Disclaimer: Do not edit files in your theme or plugin.
-
Ideas on How to Solve It – All scenarios mentioned above have the same root cause – a file permission error.
Introduction
If you are not a developer or are still new to WordPress installation and development, pause here.
Let’s try to analyze what I said earlier: “How hard is it to set privileges properly.”Solving this error is Linux-specific, and if your WordPress is on a Windows machine, this would help only as a guideline to debug, but not as an actual fix.
Linux uses file and folder permissions to know who can read, write, or execute files hosted on your account.
Remember these three words: Read, Write, Execute. These will become important and will save you some wall-banging time for sure.
Linux recognizes three different privilege groups: Owner, Group, Other.
File Permissions Calculator
While it might look tricky, calculating your permissions is super-easy.
Each number represents a group.
XXX – The first number is a numerical representation for the Owner, the second number for the Group, and the third one for Others/World.
Each number can have a value between 0 and 7.
The simple way to calculate it is to know that Read has the value of 4, Write the value of 2 and Execute the value of 1.
Ex. If you want Read and Write privileges on a file or directory, the sum of 4 and 2 gives 6.
Cheatsheet:
Number 0: No Access.
Number 1: Execute only.
Number 2: Write only.
Number 3: Write and Execute.
Number 4: Read-only.
Number 5: Read and Execute.
Number 6: Read and Write.
Number 7: Read, Write and Execute.644 and 755
By default, WordPress should have a simple setup. Files have 644, and Folders should be 755. These values mean that access to the file is granted for the Owner to Read and Write, Group can Read, and Others/World can Read. For Folders, each number is increased by one.
Most WordPress hosting providers these days would support this, and their setup will allow for this configuration.
If you still have to configure it yourself or think there is a mistake in configuration, you can easily do it using FileZilla.
Right-clicking on the directory or file will give you an options menu with “Permissions.”
777 as the Ultimate Solution
If none of the solutions mentioned above work and you stumble on a blog post or Facebook comment that says “Just set 777 on everything,” don’t do it. Please don’t do it, ever.
By setting 777, you can open a path to lots of exploits on your WordPress site. And not just to your website, as with weaker security on the server, you might endanger data on the whole machine/computer.
If the only way to have your file appropriately uploaded, or theme or plugin downloaded, is to set 777, contact your hosting provider immediately, as something is off in their setup.”