WordPress is the most popular content management system (CMS), with a solid market share of 60%. In fact, 34% of all websites online run on WordPress. WordPress powers top sites like the New York Times, Boing Boing, and Business Insider. While WordPress is powerful and popular, this doesn’t mean that it’s perfect. Sometimes, you may run into serious problems that could kill your performance.
1. Database Connection Error
WordPress uses MySQL as its database software. A database is where your generated WordPress data is stored. For example, it’s where your blog posts, pages, comments, tags, etc. are stored. If WordPress can’t connect to MySQL, nobody will be able to access the information on your site, including you. Solving this error is a tough task for WordPress beginners. But you can do it.
However, if programming or PHP code frighten you, then you may want to call your web developer, otherwise here is how to fix this WordPress error. Login to your web hosting service and go to cPanel. Inside cPanel, you’ll see File Manager. While inside File Manager, click the “public_html” folder. Once there, look for the wp-config.php file. This file contains the configuration settings for your WordPress site. Inside the file, search for “DB_NAME,” “DB_USER,” “DB_PASSWORD,” and “DB_HOST.”
If you don’t have these details, you should contact your web hosting company. But, if you know the information, you should fill them. For instance, here’s how you fill the database name: define( ‘DB_NAME’, ‘yourdatabasename’ );
And fill your database user and password that way too. Put the information where you are asked to, following the way I filled the database name example given in the above paragraph. After inputting the correct information, WordPress should be able to connect to your database, and your site should be live again.
2. Fixing 404 WordPress Error
404 errors could occur for different reasons. If your WordPress site’s permalinks setting isn’t well fixed, you can have lots of 404 errors. Old, stale, deleted content could also cause 404 errors. One or two 404 errors may not hurt your site. But many 404 errors may damage your site’s trust in the eyes of web users and search engines. The presence of 404 errors won’t encourage prospects to buy your product or service. So, how can you fix it?
First, go to your WordPress admin dashboard and click “Settings.” After doing that, click “Permalinks.” Inside “Permalinks,” select “Post name.” Use a WordPress plugin like Broken Link Checker to find all the broken links on your site. You’ll be able to fix the backlink without going to the post or page where it is located.
3. How to fix Syntax Error in WordPress
Syntax errors are common when writing programs in a popular language like PHP. Note that WordPress is written in PHP. When you write something PHP doesn’t recognize, you’ll receive a syntax error. I started coding after seeing and troubleshooting syntax errors in WordPress. And since then – 11 years ago, I’ve improved my coding skills. WordPress will tell you the exact line where a syntax error is located. If you know some PHP code, you can go to that line in your WordPress files through File Manager inside cPanel. Go to that line and use the correct PHP keyword. If you don’t know what the correct keyword is, you can do a quick search on Google on each word that appeared on the line.
For example, PHP keywords like “this” or “foreach” could have been miswritten to “tis” or “foreac.”
4. Fix a Memory Exhaustion Error
Memory exhaustion error is common in WordPress. Most times, this is due to hosting on a cheap web hosting service. There are lots of $4 per month hosting services out there. Being cheap makes them appealing, but the truth is that they offer low-quality services. Cheap services don’t provide phone support. And most of their live chat support is slow. Some could take 30 minutes before they respond to you on live chat.
If your WordPress hosting provider is cheap, expect to get a memory exhaustion error when your sites start receiving some decent traffic. Low-cost web hosting services start having problems when your site begins to receive 5,000 – 10,000 visits per month. This error makes your site inaccessible to web users. If prospects can’t view your site, there’s no way they’ll buy your products or services.
There are three ways to fix this error. The first solution is to upgrade to a better hosting plan with your current provider. The second solution is to move to a better and more reliable web hosting service. The third solution is only possible if you’ve been told that your current plan can handle the number of visits you receive. You need to get into the “wp-config.php” in your WordPress files and add this line of code:
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
The code tells WordPress to raise your PHP memory limit to 256MB.
5. 502 Bad Gateway Error and how to fix it in WordPress
A 502 bad gateway error is triggered when your request takes too long for the server to respond. There are a few reasons why your WordPress site may return 502. The error could be caused by a temporary high traffic. As I stated above, this could be solved by simply upgrading to a better hosting plan that can handle the traffic. The error can also be triggered by a purely coded WordPress theme or plugin. There are tens of thousands of WordPress themes and plugins out there. Many of them are free and coded by newbies.
If you’ve installed a poorly coded theme or plugin, you’ll have to uninstall it to solve this error. So, uninstall each theme and plugin you’ve installed. If you’ve uninstalled all your plugins, uninstall the theme too. If you’ve done that and your WordPress site is still showing the error, it may be time to contact your WordPress hosting provider.
6. 504 Gateway Time-out Error
This error is usually triggered when the server is unable to connect to an upstream server for it to complete a request. You’re more likely to see a 504 gateway time-out error if your WordPress is using a website firewall like Cloudflare or Sucuri. What these services do is protect your site against attacks from malicious parties. But sometimes, their own servers could be down. When their servers are down, your WordPress site becomes inaccessible.
How to fix this WordPress error?
You may need to turn off their service on your WordPress site. You continue using them when their servers are up and running again. But their servers are rarely down. They have servers spread across different parts of the world. So, if you use a reliable service like Cloudflare and Sucuri, you should rest assured that you won’t have to deal with this error that much.
7. Failed to Open Stream Error
This is another common WordPress error. You may find this error challenging if you don’t know any PHP. The “failed to open stream” error simply means that WordPress can’t load a file in your website code. If you see this error, it’s a sign that your WordPress developer didn’t do a good job. It may be time to find another developer who knows what to do and who can ensure that there isn’t any error in their PHP code.
How to fix this WordPress error?
If you coded your WordPress site yourself, you have to solve the problem yourself. The error isn’t a big deal even if you aren’t an experienced WordPress developer. The error message will tell you the line the mistake is in. Find that line. It could be that the file or folder specified doesn’t exist. Make sure you have the correct file and put it in the line. After doing that, refresh your WordPress site to see if it’s still returning that error. If it’s still returning the “failed to open stream” error, it may be time to hire a WordPress developer to code your site. If you continue to code your site, you may encounter lots of vulnerabilities only a senior or experienced developer could detect and fix.
8. 500 Internal Server Error
The 500 internal server error is the most confusing and challenging WordPress error for a beginner. When you see this error, it means something is wrong somewhere in your code, but WordPress won’t tell you where. Check to see if you recently updated a WordPress plugin or theme. I hope your web hosting service offers daily backups. If it does, you can always revert to the day or week before you made the update. This definitely is a performance killing WordPress error.
A corrupted .htaccess file could also trigger the error. You’ll find this file inside your WordPress files, in the same folder where wp-config.php is located. You can rename the “.htaccess” file to something like “.htaccess_old.”
9. WordPress White Screen of Death Error
This is one of the most popular and annoying WordPress errors. The error gives you a plain white screen. No error messages. Nothing. The error could occur as a result of a script exhausting the memory limit of your WordPress site. The script may get killed by your web hosting provider, which is why you may not see any error message, and you see a plain white screen. You may need to increase your WordPress site’s memory limit. I mentioned this solution above, and I’ll do that again. Here is how to fix WordPress error: simply paste this into your “wp-config.php” file:
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
10. Maximum Execution Time Exceeded Error
In PHP, there’s a limit to how long a script can run. And don’t forget that WordPress is coded in the PHP programming language. Some WordPress hosting services may set the value of this time to be higher, while others may set it to be lower. It depends on the plan you’re on. Higher plans let you run scripts for a longer time. Fixing this error is easy. Go to your WordPress folder in File Manager inside cPanel. Find the .htaccess file. Paste this code before “# END WordPress”:
“php_value max_execution_time 300”
Mixed content is simply having a file(s) that is “https://” when the site is “https://.” In case you don’t know, having the “https://” in front of your website address makes web users feel secure. Your address will have the green padlock in front of it in the browser. For example, the address of OmniKick has the padlock button because it’s “https://.”
Perhaps the site was still “https://” when you uploaded some images. Now that you have “https://,” you’ll have to convert those files to “https://.” If you don’t convert them, some visitors will get a warning message from their browser telling them that some of your files aren’t secure.
With a simple plugin like SSL Insecure Content Fixer, you can get rid of mixed content errors. Install the plugin and go to “Settings” in the admin menu. Then click “SSL Insecure Content.” Select “Simple” and click on “Save Changes” to make the change.
WordPress will continue to be the best content management system for many years to come, as no other CMS is close to beating WordPress. While some of these errors may look challenging to you, they are in fact really simple to solve. And the more you solve them, the more you know about WordPress and even PHP.
WordPress made me interested in learning PHP. And I relish every moment I’ve spent finding solutions to the above errors.
Author’s bio: Michael Akinlabi is the senior content crafter at OmniKick, a startup that creates exciting lead generation popups, and he’s also a marketing instructor at Intent Marketer. When he’s not writing, Michael is sightseeing, reading, and coding in PHP.
Image 1 by Mediamodifier from pixabay.com
Original article Published here >
* Optimise WP Website Images with ShortPixel – Super Fast Website, Optimised SEO, WordPress Plugin (Referral Ad)