Troubleshooting

Common WordPress Errors and How to Fix Them

Important

Before trying to fix any WordPress error, make sure that you have a complete WordPress backup.
The information below is retrieved from
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/


One of the most infamous and cryptic errors in WordPress is the dreaded White Screen of Death (WSoD). This error simply replaces your entire site with a blank, white nothing, leaving no error messages or further assistance.

This problem can occur for a variety of reasons and usually means your site couldn’t be loaded properly. As such, there are several methods for troubleshooting it.

We’ve actually covered how to fix the WSoD before on this blog, so we recommend that you check out our comprehensive guide to this error. However, here’s a quick summary of the things you can do to troubleshoot this particularly tricky problem:

  1. Disable your plugins. The most likely culprit behind the WSoD is a faulty plugin, so try disabling them all and see if that fixes the problem.
  2. Disable your theme. Your theme can also cause this issue, so use SFTP to replace it with one of WordPress’ default themes.
  3. Activate the WordPress debug mode. This is a useful feature that lets you see errors directly on each page, which can help you pinpoint the underlying cause of the WSoD.
  4. Purge your cache. Finally, your site’s caching solution could cause you to see outdated files even if the WSoD has been fixed. Therefore, you’ll want to clear your cache and see if that resolves the problem.
  5. Raise your memory limit. Your site might have run out of memory. You can raise your maximum limit by editing your php.ini file.

The 404 Error should be familiar to most internet users.

It signals that the server was unable to find the requested page. This error is most commonly associated with broken links and changed URLs, but it can also occur even if the page you’re looking for should be available.

When this happens, the most likely cause is again the .htaccess file. This file also handles your site’s hyperlink structure, and it’s possible that it could be redirecting your URLs incorrectly. Your first step should, therefore, be to regenerate a new .htaccess file, using the steps we outlined in the previous section.

However, in the unlikely event that this doesn’t resolve the error, you may need to re-upload .htaccess. The easiest method is to create a new file, give it the name .htaccess (don’t forget the period, and you don’t need to add a file extension), and paste in the following default code:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

You can now upload the file to your site’s root folder. In most cases, this should resolve the 404 error you’re seeing.

This is default behavior in your browser, which colors “visited” links differently from standard or active links to let you know you have clicked it before. 

Sometimes you might just need to delete one of the widgets that causes it.

OR

You can disable this behavior or customize the default color in your browser settings. Please refer to your browser’s Help tab for detailed assistance with using its options panel.

You may set the color of visited links specifically for your website if you wish. This ensures they are the same color for all visitors that view your site. The following can go in the Custom CSS box in Theme Options:

a:visited{color: #888;}

Replace 888 with your desired color code. Note that some links need special class names in CSSto be affected. 

If you permit comments on your site, you’re bound to get some comment spam. As your site grows more popular, that spam is likely to become an even larger issue. There are many types of comment spam these days, but most of it is automated, posted by spam bots that use short, generic messages as a cover for including links.

1. Reduce the number of links allowed per post

As we mentioned earlier, most comment spam is designed to add links in your comment section and trick people into clicking on them. Therefore, one way to combat spam is to permit fewer links in your comments. Legitimate visitors will also be prevented from posting many links, but slowing down the spammers can be worth that potential inconvenience.

From your WordPress dashboard, you can navigate to Settings → Discussion to make this change. Look for the Comment Moderation section:

Changing the number of links allowed per comment in WordPress.

Here you can decide how many links will be permitted in a comment before it is flagged for moderation. You can even reduce the number to zero if you want to require moderation for any comment with links.

2. Create a list of ‘blacklisted’ words

Many spam comments contain a lot of recognizable keywords. This makes it easier to spot them and to stop them from appearing on your website. You can simply create a ‘blacklist’ of words, and your site will flag any comment containing one of them.

To do this, return to Settings → Discussion in your WordPress dashboard and find the Comment Blacklist section:

Creating a comment blacklist in WordPress is a good way to stop comment spam

Here, you can enter your list of words. When any comment is posted that contains one of those words, it will be sent straight to the trash. Of course, it’s important to choose the words in your blacklist carefully, so you don’t delete comments by legitimate posters. For suggestions, you can check out the recommended comment blacklist for WordPress on GitHub.

3. Restrict comment privileges to registered users

The goal of most spammers is to post on as many pages and sites as possible. This means if you can make it more challenging for them to add their comments to your site, they may just move on to the next target.

You can achieve this by restricting comment privileges to people who have registered on your site. This puts an extra hurdle between spammers and your comment section. As a side benefit, it encourages visitors to sign up for an account or a membership.

This option is also available in the Settings → Discussion section in WordPress. You’ll find it under Other comment settings:

The Other Comment Settings section in WordPress.

Simply check the box labeled Users must be registered and logged in to comment, and save your changes.

4. Set up a comment moderation system

In a nutshell, comment moderation is when you require some or all comments to be approved by a person before they are permitted to appear on your site. If you have the time and resources to spare, this can be a smart strategy.

In WordPress, you can enable a comment moderation system very easily. Simply go back to Settings → Discussion, and check out the Before a comment appears section:

Setting up a comment moderation system in WordPress.

By selecting Comment must be manually approved, any comments made on your site will be held as Pending until they are reviewed. You can then check out each one, and decide whether to let it through or trash it. You can find more advice on setting up a comment moderation system in the WordPress Codex.

5. Use an anti-spam plugin

Finally, we would be remiss not to mention anti-spam plugins. These tools can present a powerful way to stop comment spam and can take care of sorting the good comments from the bad for you.

Many WordPress installations come with Akismet bundled in, and for good reason:

Akismet Spam ProtectionAkismet Spam Protection

Author(s): Automattic

Current Version: 4.1.7

Last Updated: December 4, 2020

akismet.4.1.7.zip

This anti-spam plugin connects to a constantly updated database of spam, so it’s very proficient at recognizing which comments are trouble and filtering them out. It also enables you to see what comments have been flagged.

Akismet is a solid option for most users, but there are plenty of excellent alternatives. For example, Antispam Bee is a well-reviewed plugin with a lot of customizable settings and features. Whatever plugin you choose, you’ll be taking an important step to stop comment spam on your website.

6. Move to a new comments system (like Disqus)

This method won’t work for all sites, but some third-party comment systems, like Disqus, can help eliminate most of the spam for you. Disqus is actually what we use here at ThemeIsle (you can scroll down and leave a comment on this post to see it in action!). Another option is to use Facebook comments on your site.

Beginner’s Guide to Troubleshooting WordPress Errors (Step by Step)

First thing you should do is to create a complete backup of your WordPress site. If you were already using a WordPress backup plugin, then make sure that you have a recent backup safely stored somewhere.

If you were not using a backup plugin, then you should start using one immediately. However, in case you don’t have access to the admin area of your WordPress site, then you will need to manually backup your databaseand files.

Backups allow you to restore your WordPress site easily when something goes wrong. They are your first and most important defence against security threats, hacking, and data loss.

A lot of times, your browser may not realize that a WordPress page or post has changed and will load it from the browser cache. This will cause you to view an older version of that page or post.

You may need to clear your browser cache to ensure that you are seeing the latest version of a page. 

If you are using a WordPress caching plugin like WP Rocket, then you may be seeing a cached version of your website. Some top WordPress hosting companies like Bluehost and Siteground also implement their own caching to improve performance.

You need to clear your WordPress cache to make sure that your website is not serving a cached version.

Most of the times errors are caused by a plugins conflicting with each other, your theme, or the WordPress core. Deactivating all WordPress plugins on your site will most likely solve the problem. You can then find out which plugin was causing the issue by activating plugins one by one on your site.

If you have access to the admin area of your WordPress site, then simply head over to the plugins page.

First, you need to select all plugins, and then select ‘Deactivate’ from ‘Bulk Actions’ drop down menu. Click on the Apply button to deactivate all selected plugins.

If you do not have access to the admin area, then you will need to use FTP or phpMyAdmin to deactivate all plugins.

Simply connect to your website using an FTP client.

Navigate to the wp-content folder and rename plugins folder to “plugin.deactivate”.

Sometimes your WordPress theme can cause issues on your site. You can easily find out if your theme is causing an issue by switching to a default WordPress theme like Twenty Nineteen or Twenty Twenty.

Head over to Appearance » Themes page and then click on the Activate button next to a default theme

However, if you don’t have access to the admin area of your WordPress site, then you will need to use FTP to switch theme.

Connect to your website using an FTP client and then navigate to /wp-content/themes/ folder. Download your current active theme as a backup to your Desktop.

After that, you need to delete all themes except a default WordPress theme like TwentySixteen. Since your active theme will no longer be available, WordPress will now automatically switch to using the default theme available.

If your theme was causing the issue, then you should be able to log in to your WordPress site now.

WordPress uses SEO friendly URL structure or Permalinks. Sometimes the permalink structure is not updated or configured properly, which may result in unexpected 404 errors on your site.

You can easily refresh permalinks without changing anything on your WordPress site. Visit Settings » Permalinks page and click on ‘Save Changes’ button without changing anything.

Update permalinks in WordPress

A corrupt .htaccess file is often the cause of the internal server error.

First, you need to connect to your website using an FTP client. The .htaccess file is located in your site’s root directory.

Since it is a hidden file, you may need to force your FTP client to show hidden files. See our article on why you can’t find .htaccess file on your WordPress site

You need to download the .htaccess file to your computer as a backup, and then delete it from your web server.

You can now try to login to your WordPress site and go to Settings » Permalinks page. Click on the Save Changes button to refresh your permalinks and to regenerate a new .htaccess file for your site.

Having incorrect settings for WordPress URL and Site URL options can also cause redirect issues, 404 errors, and some other common issues.

WordPress URL and Site URL options can be changed from admin area by visiting Settings » General page.

Changing WordPress Address and Site Address options from admin area

Make sure that both URLs are exactly the same.

If you do not have access to the admin area of your WordPress site, then you can change these URLs using FTP. There are two ways to do that using FTP:

Update WordPress URL and Site URL Settings in wp-config.php File

Once connected to your website using an FTP client, locate wp-config.php file. Now you need to edit this file in a text editor like Notepad.

Go to the line that says /* That's all, stop editing! Happy blogging. */, and just before it, add this code:

1
2
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Don’t forget to replace example.com with your own domain name. Now save your changes and upload the file back to your server.

Update URLs Using functions.php File

You can also update URLs using your theme’s functions.php file.

Open your FTP client and navigate to /wp-content/themes/ folder. Open your current active theme’s folder and locate functions.php file inside it. Now you will need to edit the functions.php file in a text editor like Notepad.

Simply add these lines at the bottom of the functions file:

1
2
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Don’t forget to change WordPress URLs from the settings page after you login to your site. Once you have added them on the settings page, you need to delete these lines from your theme’s functions file.

If your newly created WordPress site is not indexed by search engines, then this is the first thing that you should do.

Login to your WordPress site and go to Settings » Reading page. Scroll down to the bottom of the page and make sure that the box next to ‘Search Engine Visibility’ is unchecked.

Search engine visibility

This option allows you to discourage search engines from showing your website in search. It is used by webmasters when they are working on a website that is not ready to be live. Sometimes you can accidentally check this setting and forget about it.

Make sure that this option is unchecked when your website is ready to go live.

Many WordPress hosting providers do not have mail settings properly configured. This stops you and your users to receive emails from WordPress.If you are using a contact form plugin, then you will not be able to receive those emails as well. You will also not receive any WordPress notifications.

If you suspect that your WordPress site is affected with malware, then you should scan your website with website security monitoring service.

Beginner's Guide to Troubleshooting WordPress Errors (Step by Step). Retrieved from https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/

Back to top