3 Common Causes of 404 Errors in WordPress, What Can you Do about broken links?
This article will teach you how to detect and fix broken links in your
WordPress site and how to avoid these problems in the future.
Before discussing the reasons and potential solutions for the error, we must first get to grips with what it is
In a few words, an HTTP status response code informs you that the web server cannot locate the file, page, or other content you requested. HTTP status code that tells you that the resource being requested can’t be found on the server.
The page, article, file, or another type that you're trying to gain access to isn't where it should be, possibly because it was removed, relocated to another area on the server, or its address was changed. In other words, you have changed the permalink of the original article.
If you've ever seen an error page on a website, you know how aggravating it is. You're unable to locate what you're looking for, so you must choose between enduring an irritating encounter attempting to navigate through the website, searching for it in search engines, or simply leaving. And conducting site searches to try and find it, or, more likely, you simply head back to your search engine of choice and try a different website.
Now imagine that your website's visitors have a similar encounter. At worst, they won't be able to discover what they're seeking, which might be especially harmful if you own a business and want to make a sale.
Your visitors will very likely abandon your website if they encounter a 404 error, instead turning to a competitor. I certainly would be reluctant to stay on a website with a 404 simply because it can be impossible to try and find where it has gone. You cannot get into the mind of the owner. Where has it been moved to ? Where have they moved it? Or worse still, how can they be daft enough to change the permalink without redirecting? It doesn't look professional!!!
Reasons for the 404 error
1.Mistyping an URL
To be fair, this is down to human error (mostly, but there are things to do to avoid repetition). There is nothing you can do when someone types in www.wealthyaffilaite.com, or www.waelthyaffiliate.com to give a few examples. To avoid the proclivity of this, keep your domain name as simple as possible and try not to add hyphens. Full disclosure here Google as a search engine, ignores hyphens, so angela-barnes.com has as much chance of ranking as angelabarnes.com. Having said that, if I owned Angelabarnes.com, I would be cock a hoop if someone bought Angela-barnes.com.
Why would I be deliriously happy? Well, the average customer is not going to remember the hyhen. They are going to type in angelabarnes.com . if this is your own domain, then it will be branded to your needs so the extra traffic will not be targeted.
However, if you own www.renovatingoldhouses.com, I could really benefit from the traffic from renovatingold-houses.com. Ten percent of their traffic can potentially land on my website.
Nonetheless, it might have something to do with configuring your URLs. The length and complexity of a URL have an impact on how easy it is to remember. As a result, there's a greater chance of it being entered incorrectly.
This is especially significant if you're utilizing plain, numerical, or date based URL structures.
Another reason for your WordPress site's missing pages issue could be a wrong URL. When you change your Permalink Structure, you must also update your links. Otherwise, users will be unable to access the page.
After ensuring that a simple typo error is not the issue, the next alternative is to log in to WordPress and choose "Settings" from the drop-down menu.Settings – Permalinks.
Take a look at the type of URL structure that is used by your website. Compare it to your setup.
If you're receiving a "Not Found" error message from a page like https://yoursite.com:/2022/07/page-title/, your URL structure displays it as: http://www.yourwebsite.com/title-of-page/.Yourwebsite.com/2023/04/post-name but your permalink structure is set to display URLs as Yourwebsite.com/post-name, there’s your problem.
Permalinks directs users to its exact location on the web. They may return to the post later, or they may share the link with others. Additionally, because the link is a self-contained unit, it will help you organize and identify the content. If your weblink is properly structured, a user may look at it and get a sense of how your webpage is structured, as well as where they should go if they want to learn about other topics on your site.
To change your permalinks, go to posts/settings/permalinks and make sure you tick the post name option and save the change. This makes it easier for your readers to navigate the site.
2. Moving or deleting pages
A 404 error might occur when a web page has been moved or deleted without proper redirection. Redirection is a process that automatically sends users and search engines to a different URL than the one they initially requested. This is useful when you want to move content from one location to another, and you want to maintain the SEO (search engine optimization) value of the original URL.
To implement a redirect, you can use one of the following methods:
.htaccess file (Apache server): If your website is hosted on an Apache server, you can use the .htaccess file to create a redirect. The .htaccess file is a configuration file that allows you to control the behavior of your server. To create a redirect, add the following code to your .htaccess file:
Redirect 301 /angelabarnesaboutmepage.html /angleabarnesaboutme.html
As you can see, this code only changes one specific page. You have to do it every time you change a permalink
example
Redirect 301 /old-page1.html /new-page1.html
Redirect 301 /old-page2.html /new-page2.html
Redirect 301 /old-page3.html /new-page3.html
Ensure that you test the redirection after making changes to the .htaccess file to confirm that it works correctly. Remember that the .htaccess file affects your server's behavior, so incorrect configurations can lead to errors or unexpected results. Always create a backup of your .htaccess file before making any modifications.
Using a plugin
in WordPress, you can use the "Redirection" plugin. Install and activate the plugin, and then navigate to the plugin settings to create a new redirect by entering the old and new URLs. Again you have to do this every time you update a permalink to avoid 404's.
3. Conflicting themes and plugins
When you use a Content Management System (CMS) like WordPress, you often install themes and plugins to extend the functionality and appearance of your website. Themes control the design and layout of your site, while plugins add extra features or functionality. Conflicting themes and plugins can sometimes cause 404 errors, and here's why:
Incompatible code: Themes and plugins are developed by authors who may use different coding standards or methods. If two or more themes or plugins contain incompatible code, they might interfere with each other's functionality. This can lead to unexpected behavior, such as broken links, missing resources, or improper URL handling, ultimately resulting in a 404 error.
Rewriting URL rules: Some themes and plugins may rewrite URL rules to create custom permalink structures or handle specific content types. When two or more themes or plugins modify the same URL rules, they can conflict with each other, causing the rules to become inconsistent. This may result in incorrect URLs or broken links, leading to 404 errors when users attempt to access the affected pages.
Overwriting or modifying core files: While it's not common or recommended, some themes or plugins might overwrite or modify core CMS files. When this occurs, essential functionality may be disrupted, leading to broken links, incorrect URL structures, or malfunctioning redirections, resulting in 404 errors.
To resolve 404 errors caused by conflicting themes and plugins, you can try the following steps:
Update your themes and plugins: Make sure all your themes and plugins are up-to-date, as developers may have already fixed compatibility issues in newer versions.
Identify the conflict: Deactivate your plugins one by one and check if the 404 error is resolved after each deactivation. This can help you pinpoint the plugin causing the conflict. If the issue persists after deactivating all plugins, try switching to a default theme to see if the problem lies within your active theme.
Seek support: Once you've identified the conflicting theme or plugin, reach out to the developer for support or search for known compatibility issues and solutions in their documentation or support forums.
Find alternatives: If the conflict cannot be resolved, consider finding alternative themes or plugins that provide similar functionality without causing issues.
Remember that it's essential to keep backups of your website before making significant changes, such as updating or deactivating themes and plugins. This will allow you to restore your site to its previous state if something goes wrong during troubleshooting.
Recent Comments
33
I have seen these errors quite a bit, but was unaware of the cause until I read this article. Thanks.
Jim
This is truly a valuable information to have. Thank you Catherine!
Do we have a list of incompatible themes and plugins? Or where do we get the list?
There is no list Maria, because it would be impossible to compile because of the huge number of themes and plugins. Just be aware stick to well coded themes, rather than themes that you have chosen because it looks good. Check your theme first in the event of a conflict (just because it is easier to do). Replace your theme with a default theme WP 2023. And see if that makes a difference. Usually it is the plugins. Then you have to deactivate everyone until you find and delete the culprit.
One of the reasons you should keep plugins to the absolute minimum and use code wherever possible
Haha! As I am not so techy, and hesitant to change what I built, I won’t change something unless I need to.
Yeah, I keep my plugins up to about 5 and install and deactivate when I need to.
But I am curious about themes and plugins incompatibility, there should be a list/code somewhere to help us out. Hmmm 🤔
Thank you Catherine. This has been bookmarked as one of my resources.
Cheers,
Maria 🌹
There cannot be a list lets say there a thousand themes, there are a whole heap more. Lets take one theme say Generate Press, and then there are 3,000 plugins. Lets say you take that one theme, how many different possible combinations are there with 3000 different plugins. To calculate the total number of theme-plugin combinations, you would multiply the number of themes (1,000) by the number of plugins (3,000), resulting in 3,000,000 (3 million) possible combinations. the 3,000,000 represents one theme and one plugin . Now can you see why that list would be impossible.
It's important to note that this number represents all possible combinations and not just incompatible ones. Determining the actual number of incompatible combinations would require testing each theme-plugin pairing, which would be a complex and time-consuming task. Moreover, incompatibilities may change over time as developers update their products or users customize settings.
In practice, creating such a list might not be feasible or efficient, which is why it's more practical to rely on community-driven support and testing for specific combinations.
You are using good practices with themes and plugins that is the best you can hope for. If it ain't broke dont fix it
See more comments
Catherine, I think 🤔 I made a newbie oops. Maybe its not related to a 404 error. I think I goofed for indexing so does that mean I need to do a redirect? It was About Brenda but the url says start here when I did not type that in the title. I have no idea 🤷♀️ how I goofed on that one. So maybe this post should help with that. Just in time when I got the notification today to fix the errors in GSC- yikes 😳!
Awesome. In answer to your question, you should have two distinct pages. About and start here, in my humble opinion. not everyone would agree, but in my mind, if I click start here, I am looking for a set of precise instructions, not a blurb about someone's life. So change your permalinks and then do a redirect. PM me if this is not clear
Of course any time Brenda