23 Sep Common WordPress Theme Error and How To Fix Them
An error occurring while operating a WordPress theme or site is not something unusual. However, getting them fixed and back to working can be a tedious and time-consuming task. It often eats up your working hours of seeking potential clients and money since you are unable to do anything at the earliest.
This blog tells you what exactly has to be done if any of the below-mentioned problems occur for a speedy recovery.
#1 – Internal Server Error
The most complex error that a beginner would come across is “internal server error,” also known as “500 internal server error”. It usually appears when something goes wrong, but the server is unable to detect the problem. The internal server error is often caused by theme or plugin functions. Other causes of the internal server error in WordPress that are known are PHP memory limit and corrupted .htaccess file. The error also occurs when you try to enter the admin area.
Looking out for corrupt .htaccess file
In WordPress, the .htaccess file is used to rewriting URLs, making them more readable and cleaner by search engines and humans. When troubleshooting the internal server in WordPress, the first thing to be done is checking for the corrupted .htaccess file. This can be done by renaming your main .htaccess file. To rename your file, you have to log in to your site using the file manager app or FTP in your hosting account’s cPanel dashboard.
Once connected, you will find your .htaccess file in the same directory that contains folders like wp-admin, wp-includes, and wp-content. After renaming, try visiting your site to see if the issue is solved.
At last, go to settings>permalinks and click the save button without making any changes. This generates a new .htaccess file for you with proper rewrite rules to ensure no occurrence of the 404 error.
Increasing the PHP memory limit
If the above method doesn’t work for you, then this is what you should do next. Sometimes, the internal server error occurs when you exhaust your PHP memory limit. If you see the error only when you try logging in to your WordPress admin or uploading an image in your wp-admin, then you should increase your PHP memory by following the steps given below:
- Create a blank text file called php.ini
- paste the code: “memory=64MB” there.
- save the file
- upload it into your/wp-admin/folder using FTP
This should probably solve your problem. In case increasing the PHP memory limit did not fix the issue for you, then you have to foot in for some more troubleshooting.
Deactivate all plugins
If none of the above-mentioned solutions worked for you, then what you are facing is probably an error caused by a specific plugin or a group of plugins unable to function together. To fix this, you have to deactivate all the plugins at once. If doing this solves your problem, then it was one of the plugin causing it. Now, go to the WordPress admin area> plugins and reactivate the plugins one by one till you find the one that caused the error. At last, get rid of the plugin and report the error to the plugin author.
Re-uploading core files
If the plugin option wasn’t successful in solving your problem, then you must try reloading the wp-includes and wp-admin folder via a fresh WordPress install. It may solve the problem if any file was corrupted plus will not remove any of your information. To do this you need to visit the WordPress.org website>click down>extract the zip file> connect to your WordPress website using an FTP client> WordPress folder> wp-includes and wp-admin folders> upload> select “overwrite” and “always use this action”.
Asking your hosting provider
If none of the above methods were able to fix your internal server error, then it is probably time to seek external help. You should contact your support team, and they would be able to detect the root cause by checking the server logs.
#2 – Syntax Error
This error majorly occurs when one tries to add code snippets into WordPress and misses something or types with the wrong syntax. This results in a PHP parse error. The error indicates the location and the unexpected thing found in the code which caused the error.
Usage of proper syntax to avoid errors
You should first have a look at the guide to pasting the snippets from the web into WordPress. A tiny yet crucial mistake mainly causes the syntax error in your code syntax. An extra curly bracket or a missing comma can break the entire script.
Fixation of syntax error using FTP
To fix the syntax error, you can either set the syntax or remove it. The only way to fix this is to access the file you last edited using FTP. Install the FTP program and connect it to your website. Then go to the theme file that requires editing. In case you do not know the location of the file, look at the code. You will know which file and the line need editing. You can then either remove the code written or edit it with the right syntax. Once done, refresh the page, and you are good to go.
#3 – Blank Screen With No Error Message
The error occurs with a blank white screen displaying no message at all. This is the most confusing part as nobody knows where to look and what to fix. Usually, it occurs when a script exhausts the PH memory limit. It may also occur due to a configuration on the server. A user may see a blank white screen only on individual sections of their site.
WordPress recovery mode
If a WordPress theme or plugin causes the white screen of death, then WordPress would be able to catch it. With WordPress version 5.2, you either get a message of a recovery mail along with the blank screen that helps to recover your data.
Increasing memory limit
This error majorly occurs when a script has exhausted the PHP memory limit. To fix this issue, you can increase the PHP memory available to WordPress.
Disabling all plugins
If increasing the memory limit doesn’t resolve the problem, then you need to start troubleshooting. It is often seen that the problem is in a specific theme or plugin. If you can access the WordPress admin area, then go to Plugins> Install plugins>select all the plugins> bulk actions> Deactivate. In case you don’t have access to the admin area, you can deactivate all plugins via FTP. Connect to your WordPress site using an FTP client, then go the wp-content folder and right-click on the plugins folder and select rename. Your FTP client will now rename the plugins folder. The word press searches for a folder named “plugins,” and when it can not find the folder, it merely deactivates all the plugins.
Replace theme with a default theme
If the plugin troubleshooting doesn’t help, then you should try replacing your current theme with any default theme. To do it, connect to your website using an FTP client. then go to the wp-content/themes/folder. Then right-click and select your current WordPress theme and download it as a backup. Then right-click on your theme folder and press “delete.” Now the default theme will automatically take its place.
Enabling Debug mode
If none of the above methods helped you, then this is what you should do. Turn on debugging in WordPress. This allows you to see what errors have been outputted. You are provided with a code that you have to add in your wp-config.php file. Once added, your blank screen will begin to show notices, errors, and warnings. This will make the task of finding the root cause easy. If you don’t see any errors, check the debug log. There, you will find a file containing all the notices, errors, and warnings.
Clear WordPress Cache
Sometimes, not the backend, but the front-end of the site might have a blank white screen. This happens due to the caching plugin. To get this working, empty your cache.
Fixing longer articles
If the white blank screen occurs only on a generously long article, then this might work for you. Increase PHP’s text processing capability by increasing the backtrack and recursion limit.
#4 – The Sidebar Below Content Error
This error occurs when the sidebar appears below the content rather than appearing beside the content. The cause of it is mostly WordPress themes. It may also occur when the wrong code is added to the snippet like an extra curly bracket or a less tag. Another probable cause is not clearing float properly or using disproportionate width in CSS.
Usually, there is an unclosed div element on the page or an extra div element being closed on the page, which makes it appears as if the sidebar is outside the wrap element. To fix this, look through anything you have recently changed. Like any HTML related changes, the addition of a plugin or any page content has div—blocks in them. One of the best ways to find out the errors is by using the W3 Validator. Remember to use add float: left and float: the right to the appropriate elements.
#5 – Memory Exhausted Error
This error occurs when a plugin or WordPress script exhausts the default allocated memory size limit. It is usually displayed by an error message of a default white screen.
Increase PHP memory limit in WordPress
Edit the wp-config.php file on your WordPress site located in the root folder. It can be edited via a file manager or an FTP client. Paste code in the file. The legend tells WordPress to increase the file’s memory to 256 MB. The memory exhausted error should disappear by now.
#6 -Technical Difficulties
WordPress introduced an error protection feature in its version 5.2. This feature displays a simple message stating, “This site is experiencing technical difficulties.” WordPress then sends you an email on your WordPress admin email address addressing the problem in detail.
The email consists of a link to access the backend and attempt to fix the error. It is nearly impossible to fix it if you do not have access to the admin email. The most efficient way to fix this is to make sure your WordPress admin email is correct, and you can receive its notifications.
#7 – Database Connection Establishing Error
In this situation, the message displayed is clear that the website is unable to connect to the database. This usually occurs when a user has modified and entered their database credentials incorrectly. Sometimes, your database may have corrupted, or your database server could be unresponsive.
Check your WordPress database credentials
The most common reason for database connection error is incorrect database credentials. If you have changed your host recently, then this is the most probable reason. Your wordpress database credentials are kept in the wp-config.php file. It contains basic wordpress settings, including database information.
Check your database host information.
If you ensure that your database username, password, and name information are correct, then you must check your database host information. Most hosting companies use localhost as their database host. However, some companies use separate servers to host databases. In this case, your database host won’t be your localhost. You need to contact the hosting company you are associated with to confirm your database host information.
Repair WordPress database
If errors like the unavailability of one or more databases occur, then you need to repair your database. This can be done by adding a core in your wp-config.php files.
Check if your database server is down.
If everything seems to be working just fine but you still cannot connect to the database, then your server must be down. This happens due to poor internet connection or heavy traffic on the website. Your site gets slow, and you may even get errors in your outputs. So, you must check the server if nothing else works for you.
In this blog, we tried our best to discuss and provide solutions about some commonly occurring technical errors in WordPress. Contact us if you want to know answers to more of your queries. We hope our articles has served its purpose of making you aware of the things you can do yourself when any such problem occurs rather than paying to technicians.
Also, to know about some of the CSS related wordpress theme problems, click here.
Frequently Asked Questions – WordPress Errors
Are these the olnly problems that occurs within wordpress?
No, every technical art has its own advantages and faults. Yes, there are a lot of errors when functioning with a platform that big. But every problem comes with a solution.
What if none of the mentioned method works?
Well, in that case, you have to contact the support team as it would then be a very critical and technical error.
How much the support theme charge?
It totally depends on the theme you work with. If you work with a premium theme, then mostly, technical support is free for you. Whereas in some cases, you might have to pay to get these services.
What does downtime means?
When a site experiences an unusual amount of rush, it often tends to stop functioning or begins causing glitches. At this time, you become unavailable to your clients. This is known as downtime.