• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Fix WordPress 404 Errors For Non Existing URLs

By Abhishek Ghosh August 23, 2014 12:21 am Updated on August 23, 2014

Fix WordPress 404 Errors For Non Existing URLs

Advertisement

It is usual to get huge 404 errors like that of post images in Google WebMasters Tools. Here is permanent fix for these WordPress 404 errors. Usually we face three or four types of 404 errors. These can get exacerbated when Google Bots re-crawls the whole site, usually an old site again for some reason – change in server (crawl increases on A Grade web hosts due to many factors), change in domain ownership data, implementing site-wide HTTPS, changing the domain name etceteras. WordPress is not very web software – it is a PHP driven, resource hungry web software. WordPress is famous for Frontend HTML output; but basically WordPress is not a web software which can be labelled as new generation web software. MySQL is one of the best database software, WordPress can make it appearing as a living problem. PHP is not very good programming language itself plus some core files create logical conflict in the database. Add the penalty for the badly coded Plugins.

WordPress can make a very good website with lot content to appear as spammy to search engine bots, it can render the webmaster appearing a lazy person.

 

Understanding Types of 404 Errors Before Fixing WordPress 404 Errors For Non Existing URLs

 

Many years ago we wrote about some 404 WordPress Plugins. Redirection is the best plugin to internally monitor the 404 errors, use PHP based 301 redirections. While 301 Redirection is usually good for a moved content, it is kind of black hat to do 301 against the URLs which never existed. Also, if you get 1000 404 errors against 5000 URLs on your website, neither it is practical to manually do 301 redirection nor it will do anything good. Suppose you are 301 redirecting :

Advertisement

---

Vim
1
https://thecustomizewindows.com/2011/09/windows-7-speech-recognition-related-tutorials-compiled-index/

to :

Vim
1
https://thecustomizewindows.com/2011/09/windows-7-speech-recognition-related-tutorials-compiled-index/

Google or any search engine will never take it as bad attempt. Even you can change the permalink structure :

Vim
1
2
https://thecustomizewindows.com/windows-7-speech-recognition-related-tutorials-compiled-index/
# it does not exist, please do not try the URL

Google bots understand /2011/09/ has nothing to do with title or text on the webpage. On SERP, they usually get stripped off on green colored URLs. But, if you have something like this as 404 :

Vim
1
https://thecustomizewindows.com/windows-7-speech-recognition-related-tutorials-compiled-index/windows-7-speech-recognition-related-tutorials-compiled-index/

and you again do a 301 redirection to :

Vim
1
https://thecustomizewindows.com/2011/09/windows-7-speech-recognition-related-tutorials-compiled-index/

this is not good. Basically Google was trying to fetch the image file like this :

Vim
1
https://thecustomizewindows.com/wp-content/uploads/2011/09/windows-7-speech-recognition-related-tutorials-compiled-index.png

 

Fixing WordPress 404 Errors For Non Existing URLs – Conflict of MIME Types

 

Google understood the MIME Type. If you really served an image with trailing slash stripping the file extension, it would do no harm. But a soft 404 on first attempt and 301 later can simply harm your SERP and Google Bots crawling. Unless whitelisted manually ( there are only few domains ), this is a big mistake to do 301 redirection to an internally appearing link from a static file within a page. SEO Experts are born to cheat, they will offer you some WordPress Plugin to automate the 301 process and show all error gone away. Here is a simple cURL command to show you how a computer will logically think :

Vim
1
curl -I https://thecustomizewindows.com/Windows-7-Speech-Recognition-Related-Tutorials-Compiled-Index/Windows-7-Speech-Recognition-Related-Tutorials-Compiled-Index/

Here is the return if we do a 301 redirection :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
HTTP/1.1 301 Moved Permanently
Server: nginx
Cache-Control: no-cache, must-revalidate, max-age=0
Content-Type: text/html; charset=UTF-8
Date: Fri, 22 Aug 2014 17:59:22 GMT
X-Pingback: https://thecustomizewindows.com/xmlrpc.php
Location: https://thecustomizewindows.com/2011/09/windows-7-speech-recognition-related-tutorials-compiled-index/
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Pragma: no-cache
Transfer-Encoding: chunked
Connection: Keep-Alive
Set-Cookie: X-Mapping-fjhppofk=F778D0884D86358FEB6DFC2C6852207C; path=/
Set-Cookie: PHPSESSID=3inlme1mrsoob8plb8vslre4o3; path=/
X-Powered-By: PHP/5.5.9-1ubuntu4.3

Look at the Content-Type, it has been changed to text/html. It can mean to Google Bot’s logic that you are auto generating content. This is first issue, second is – your real image file is not getting indexed. You are dually penalized. Forget about the extra load on servers for doing 301 using PHP via Plugin. But if I run cURL with the image URL :

Vim
1
curl -I https://thecustomizewindows.com/wp-content/uploads/2012/04/Internet-Media-Type-or-Content-Types.png

I will get this return :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
HTTP/1.1 200 OK
Server: nginx
Cache-Control: max-age=86400, max-age=86400, public, must-revalidate, proxy-revalidate
Content-Type: image/png
Date: Fri, 22 Aug 2014 18:08:19 GMT
Expires: Sat, 23 Aug 2014 18:08:19 GMT
Pragma: public
Accept-Ranges: bytes
ETag: "4e801b2e-3e27"
Connection: keep-alive
Set-Cookie: X-Mapping-fjhppofk=F778D0884D86358FEB6DFC2C6852207C; path=/
Last-Modified: Mon, 26 Sep 2011 06:26:54 GMT
X-Cache-Info: caching
Content-Length: 15911

Fix WordPress 404 Errors For Non Existing URLs

Look at the Content-Type, it is rightly image/png. It will mean to Google Bot logic that this is not for indexing on Google Web Search, this will be referred to Google Image Search Bot. Whether you have a XML site map for images or not, invariably Google Image Search will list it. We use XML site map for images for faster indexing.

Yes, it is possible to get all the headers of all the contents of a web page with cURL. It will require a full tutorial how to do it – that is off topic but practically all search engine bots will run equivalent script for initial evaluation of a webpage.

 

Understand Why It Arises Before Fixing WordPress 404 Errors For Non Existing URLs

 

We Must Not Have Any /post-name/post-image-name/ Type of 404 Errors.

I am telling you how to detect it and resolve it. It has nothing to do with Apache2’s .htaccess, WordPress Permalink or anything related to server. If you have fixed it by virtual host file manipulation, you are far away from detecting the issue. This is kind of prescribing pain killer for treating a patient suffering from cancer. Pain will get reduced – but the disease will not get proper treatment.

First disable any kind of caching – plugin or any server side cache. Clear all the cache directories content by recursively removing from SSH. Disable all the Plugins except Hello Dolly like 100% good plugins. Disable all cache settings, delete all kind of cache – database, object cache etc. Disable CDN. Activate WordPress default theme. Now you have no SEO Plugin. For very bad database you might need to throughly wash your database. But this is among the last options. Go to any post any hover or right click on the attachment image. It should be like my this page (current one has done nothing wrong, if you want to see another example) :

Vim
1
https://thecustomizewindows.com/2013/07/remove-wordpress-plugin-from-database/

If I hover on the image, it should show me the full URL :

Vim
1
https://thecustomizewindows.com/wp-content/uploads/2013/07/Remove-WordPress-Plugin-From-Database.png

If I click the image, that image should open or hardly it can point to another webpage like category. If I overdo on page SEO any link towards the parent page, with pretty permalinks ON, it will create an endless loop – quite normal. Most of the Plugin developers (and WordPress itself too) do this wrong. This is not a physically existing directory or page :

Vim
1
https://thecustomizewindows.com/2013/07/remove-wordpress-plugin-from-database/

The original is quite pathetic looking :

Vim
1
https://thecustomizewindows.com/index.php?p=36395

So, we committed a kind of crime 301 at least once! If you used that ugly URLs, linking to the originating post would not create an infinite loop. Because that attachment’s (image) url would also be a different looking and ugly. For that post, WordPress has assigned a reference number – wp-image-36399. For managing that part, WordPress has Media Library.

You wanted to redirect the attachment page to the original post – otherwise with pretty permalinks ON, you’ll get duplicate content issue. Someone ( plugin or theme ) has created this URL for attachment page :

Vim
1
https://thecustomizewindows.com/Windows-7-Speech-Recognition-Related-Tutorials-Compiled-Index/Windows-7-Speech-Recognition-Related-Tutorials-Compiled-Index/

It is likely (why likely, this is definitely the reason) that you are using one or two plugins or ways for attachment page redirection (with or without knowing you are doing) and using a PHP based template for auto generating attachment page link. Double logic making PHP confused and it is printing a bizarre URL.

Show me a single fresh WordPress Installation with 3-4 posts, with default themes or plugins; where this problem is present – it will never happen. From technical point of view, we should use this format :

Vim
1
https://thecustomizewindows.com/index.php?p=36395

But, Google has faulty algorithm ( it is possibly not correctable ) – Google gives priority to the KEYWORDS on URLs – that is why people pay a huge to acquire EMD and BMDs. Exact matched domain with exact matched Post URL with good content will always rank higher up. For Google’s fault we actually use the pretty permalinks. ?p=36395 is technically used by WordPress all processing on the backend.

 

Fixing WordPress 404 Errors For Non Existing URLs – For The Above Type of 404

 

So we have explained the mechanism of action behind the problem. You have to make it like default WordPress settings – image should be image. You can only redirect the attachment page to the original post by setting the logic once only. If you have done some error by manual working – sadly, you need to edit all the pages – there is no SQL query which can solve the issue – there is query, but it can destroy / un-associate the GUID. After you are 100% sure that there is no such odd url are getting auto generated, go to Google Webmasters Tools and select all the errors and mark as Fixed. In Redirection Plugin, reset the log.

Obviously you will get some GENUINE 404 errors – they can be only be detected from only Redirection Plugin not Google Webmasters Tools. You can 301 redirect such pages to proper post or category. It happens that we have wrongly linked any example like https://thecustomizewindows.com/anyname.php, it is better to create a real file with minimum information.

If you ever did any manual on page optimization for the images by manually inserting urls to the images, we will suggest to check all the posts. It sounds horrible, but actually you’ll find that you have not done the crime more than 25% of all the posts. Edit 10-20 posts everyday. Also it will help to correct any typographical errors. There is no such plugin or SQL query exits which can fully reset to default – as you have manually overridden, you have to manually correct. Also Google Webmasters Tools will start reporting of such small number of posts as 404. As hopefully they will not cross more than 100, you can do it manually. Obviously it is better to avoid getting caught by Google Bots for the second time. One hint – Redirection Plugin catches the error before Google Webmasters Tools report! So, you have to keep an eye almost like an army!

Tagged With wordpress 403 non existing urls , fixing HTTP 403 , wordpress non existing URL catch all , wp redirect non existing url

This Article Has Been Shared 190 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Fix WordPress 404 Errors For Non Existing URLs

  • Cloud Computing : Are the users becoming more dependent?

    Cloud Computing already offering us various scopes and opportunities.It may be important to check whether we are becoming too much dependent on Cloud Computing.

  • Ubuntu Cloud Guest Instance : Our Test Drive

    Ubuntu Cloud Guest Instance is actually hosted on Amazon EC2 and a kind of ready made solution as PaaS is provided by Canonical for free of cost to test.

  • Installing an Advanced Pastebin on Rackspace Cloud Sites

    Installing an Advanced Pastebin on Rackspace Cloud Sites can be done with Stikked, adding Twitter Bootstrap like interface to make it more attracting, light.

  • Elliptical Cryptography (ECC) and Software Defined

    The Encryption by Elliptical Cryptography (ECC) encryption could ensure safety and performance for Software Defined without much computing power.

  • Apache to Nginx on Cloud : Checklist

    Here is a checklist for those who want to unlock speed by migrating from Apache to Nginx on Cloud Server but have lesser technical knowledge. Nginx initially will appear scary but actually it is easy to use.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Why Not to Use Your Host for Email Marketing March 5, 2021
  • What You Need to Know About the Microservices March 4, 2021
  • Fix Missing/Bad FileProvider for Freshchat (Android error code 354) March 3, 2021
  • Basics of Data Protection on the Internet March 2, 2021
  • What is Standard Software February 28, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Fix WordPress 404 Errors For Non Existing URLs," in The Customize Windows, August 23, 2014, March 6, 2021, https://thecustomizewindows.com/2014/08/fix-wordpress-404-errors-non-existing-urls/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy