WordPress is a very popular blog software for many different reasons. In addition to being free, versatile and extremely user-friendly, WordPress is among the most stable of the available blog platforms. Still, there are times when you may have to troubleshoot a WordPress problem.
Identify the problem. You need to know whether the problem is with a WordPress plug-in, Theme or during installation for example, or with a built-in WordPress feature such as the text editor. Write down the error message you receive, or the incorrect behavior you observe.
This article contains information on solving common WordPress problems, dealing with comment spam and even troubleshooting problems with design and layout.
Troubleshooting WordPress And Fixing Errors
During installation, different problems may arise. If you are familiar with them, you may sort them quickly, without hunting around for solutions.
1. Problem: Headers Already Sent
Sometimes, when you point your browser to the blog, you may get an error that displays “headers already sent” message on your page. The whole page may look scrambled and it will not function.
WordPress uses PHP session functions. If anything is displayed before these session functions, which may even be a blank space, then the session functions will not work properly because your browser has already received all headers and it starts displaying the output. In such circumstances, this error may occur.
You have to figure out where the error has occurred. Most of the time, it is a file that you have edited manually. If you remember, you edited the
wp-config.php file while installing WordPress. Open the file with your text editor and make sure that there is nothing before the
<? at the first line and after the
?> at the last line. Now save this file, upload it to your WordPress directory, and refresh your page again.
2. Problem: Page Comes with Only PHP Code
This could only happen when your server cannot parse PHP properly. This is a problem of your server configuration; either PHP is not installed on your server or it is not configured to function properly. To solve this problem, contact the system administrator for your server or try installing PHP.
3. Problem: Cannot Connect MySQL Database
If WordPress cannot connect to the MySQL database, it shows a page with the following error:
To solve this problem, open your
wp-config.php file and check whether the database parameters are correct. If you are sure that these settings are fine, please check if the MySQL daemon/service is running properly. If MySQL is not running, run this service. If MySQL was running, try restarting the service.
In MySQL version 4.1 and later, password encryption settings have been changed a bit, so PHP cannot connect to some versions of MySQL. If you are sure that your database parameters are fine and MySQL is also running, then connect to MySQL using your MySQL command-line tool and apply these commands:
set password = OLD_PASSWORD('your_current_password'); flush privileges;
This will use old encryption of passwords so that PHP can connect to MySQL. For example, let’s assume my current database password is
root with new encryption settings. I want to change it to old encryption settings.
Following are some basic and common problems that you may face while using WordPress.
4. Problem: Cannot See Posts, All It Says is Search Doesn’t Meet Criteria
This could happen because of caching. For example, you have searched once and WordPress stored the search result inside its cache. So every time you visit the page you see the old result. You can solve this problem by clearing the cache and cookies from your browser. For this problem, you may also check
index.php for errors.
5. Problem: I Want to Make My Blog Totally Private
If you are running your blog for a personal and private group or for your own official department so that only members of your group can see it, then you would want to secure it with some kind of authentication. WordPress has no built-in facility to do it. All you have to do is modify your
.htaccess file to enable basic HTTP authentication. For that, you have to create the
htpasswd file using the
htpasswd command in Linux. If you are using Windows, then search in Google for
htpasswd.exe and download it from a reliable location.
Let’s create the
htpasswd file by applying the following command in your command line:
htpasswd -cm .htpasswd myusername
htpasswd command is a command-line tool available in all Linux distributions by default. Immediately after applying this command, the command-line tool will prompt you for a password; type your password. Please note that an
htpasswd file containing the encrypted password has been created in the current working
directory for user ‘username’. Copy that file to your WordPress folder. The
htpasswd file itself is of no use, until you tell Apache what to do with it. So let us create a
.htaccess file in your WordPress folder with the following content, which will tell Apache to turn on basic HTTP authentication using that
AuthType Basic AuthName "Restricted Area" AuthUserFile "absolute_url_of_your_.htpasswd_file" require valid-user
Save this file inside your WordPress directory as
.htaccess. Now whenever you browse this WordPress URL using your browser, it requires the username and password that you created previously. You must supply the absolute URL of the
htpasswd file in the
.htaccess file; it will not work with a relative URL. For example, if your WordPress folder is located inside the
/home/youraccount/public_html/wordpress folder, then the location of the
.htpasswd file should be
If you have trouble retrieving this absolute path, then please don’t worry. Create a PHP file inside this WordPress folder with the following code:
<? phpinfo(); ?>
Now run this file. You will see a page with a lot of text. Search for the text
_SERVER["DOCUMENT_ROOT"], and you will find the absolute URL of this folder on the right-hand side of it.
6. Problem: I Don’t Receive The Emailed Passwords
This problem may happen if your web server has no SMTP server installed, or if the mail function is explicitly disabled. Please contact your system administrator or try installing Sendmail (or any other mail server) properly. It should work.
7. Problem: I Am Getting A Lot of Comment Spam
You have already got an idea how people can misuse some very useful features of a blog engine, like trackbacks and comments, for advertising purposes and spamming.So all you have to do is start fighting with spams. No doubt, it’s very tough to make some automated programs or routines that can detect something as spam because spams don’t always fall into a specific category. Moreover, spammers are also clever.
For more to detail about getting rid of spammers look at “How to Maintain Your WordPress Site” and “Stopping spam with reCAPTCHA”.
Once WordPress is up and running, people often encounter issues with things like themes. For example, they might want the date to show up in the theme and when it doesn’t by default, they can’t figure out why. Other problems might have something to do with folder permissions that prevent them from uploading images.
8. Troubleshooting Themes
Put the blog back into the default theme.
Go to Dashboard -> Appearances -> Themes -> Find the TwentyTen theme (or Default Theme) and select activate.
If your current theme has more than one sidebar, I highly suggest moving your custom widgets into the inactive widgets area (careful not to drop them in the available widgets area) to protect them from any possible confusion when the sidebar they are in is not present in the TwentyTen theme. If your current theme is a single sidebar there’s usually no need for this.
9. Troubleshooting plugins
Often, you will notice that problems arise for plugins after a large update to the entire WordPress platform. In any case, the following are a few tips to try if you encounter any problems getting your plugins to run. My plugin stops working after an update—Check the Plugin’s website (listed in the Plugin Browser) to see if any known issues exist.
I can’t find the plugin in my Plugin Browser—Make sure you uploaded it to the correct folder: wp-content/plugins.
Check the plugin’s version compatibility—There is a chance that the plugin just won’t work with a new version of WordPress; if this is the case, hopefully, the developer will release an update soon.
My plugin says I don’t have permission to X folder—Permissions are settings on files and folders that either allow or disallow a user to write to them. You can learn more about setting permissions at WordPress Codex.
My plugin should be showing X on my post, but it’s not—Many times, a plugin requires you to place a custom tag within your post to “trigger” the plugin; read the plugin’s installation documentation.
I can’t find the answer on the plugins’ website—A quick google search for “problems installing [PLUGIN NAME] on WordPress” will lead you to an answer. You can also check the forum link on the plugin’s homepage in the plugin directory at https://wordpress.org/plugins/.
Google didn’t give me the answer I was looking for—Search WordPress’s plugin directory for a different plugin.
I hope you also learned that while WordPress can rock your world, It can also be dangerous and should always be handled with care. There are many benefits to using WordPress and some will only be beneficial to plugin developers, while others exist purely as workflow enhancers for content producers.