Title: does not return a 404 HTTP status code
Last modified: December 28, 2018

---

# does not return a 404 HTTP status code

 *  [Leopard-Lady](https://wordpress.org/support/users/leopard-lady/)
 * (@leopard-lady)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/)
 * I have set up a custom 404 page and have it set to be the destination for all
   broken links. Unfortunately, though, it does not return a 404 HTTP status code.
   It returns an 200 HTTP status code.
 * Is there any way to correct this in the plugin?
    Or via functions? Or via server
   settings?
 * Other than this one issue, I’ve never had a problem with your plugin. It works
   perfectly.
 * Thank you,
    LL

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Leopard-Lady](https://wordpress.org/support/users/leopard-lady/)
 * (@leopard-lady)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11219029)
 * **I’ve found a simple solution to this problem and want to share it with others
   having the same problem.**
 * Install the 404page plugin – [https://wordpress.org/plugins/404page/](https://wordpress.org/plugins/404page/)
 * Follow the instructions to select your custom 404 page, leave the _Send an 404
   error if the page is accessed directly by its URL_ setting enabled AND also enable
   _Activate Compatibility Mode_ — compatibility mode ensures that these 2 plugins
   work correctly with each other.
 * Now your custom 404 page outputs the proper 404 HTTP header status code AND you
   still have all of the functions of the 404 to 301 plugin.
 * I use 404 to 301 because I want to receive immediate notification of 404’s on
   my sites and have the ability to easily redirect them from the 404 logs. This
   helps me to control redirects for SEO purposes, alerts me to unintentional 404’
   s due to errors I’ve made and also makes it easy to add nefarious IP’s to my 
   WordFence firewall blocking rules for tighter security management.
 *  [thoughton](https://wordpress.org/support/users/thoughton/)
 * (@thoughton)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11407172)
 * Thanks for this Leopard Lady.
 * I couldn’t believe my eyes when I discovered this 404-301 plugin is sending a
   200 response. The whole plugin is pointless if it’s going to do that.
 * Looking back through the support threads the author is aware of this but apparently
   hasn’t done anything about it yet: [https://wordpress.org/support/topic/how-to-keep-404-status/](https://wordpress.org/support/topic/how-to-keep-404-status/)
 *  Plugin Author [Joel James](https://wordpress.org/support/users/joelcj91/)
 * (@joelcj91)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11407187)
 * Hey [@thoughton](https://wordpress.org/support/users/thoughton/),
 * Yes, I’m aware of this issue. The main purpose of this plugin is to avoid 404
   errors. So, we are redirecting those requests to an existing page.
 * Since it is requested by many users, I’m already working on this feature. Soon
   we will be able to set 404 status for the redirects 🙂
 * Regards,
    Joel
 *  [thoughton](https://wordpress.org/support/users/thoughton/)
 * (@thoughton)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11416001)
 * Great to hear that Joel, thanks!
 * The main issue is that search engines, esp. Bing, see the 200 code and consider
   the broken/expired URL to be a valid link. So if you unpublish a page it never
   gets removed from Bing’s index.
    -  This reply was modified 7 years, 1 month ago by [thoughton](https://wordpress.org/support/users/thoughton/).
 *  Thread Starter [Leopard-Lady](https://wordpress.org/support/users/leopard-lady/)
 * (@leopard-lady)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11436019)
 * Hi Joel – [@joelcj91](https://wordpress.org/support/users/joelcj91/)
    This is
   awesome good news. Thank you for working on a way to implement this.
 * As thoughton pointed out, it is troublesome that the 404 header is not fired 
   correctly. And not only from the perspective of search engines indexing non-existant
   or removed page URLs, but also in regards to external broken link checkers and
   even broken link check plugins. They’re all looking for the 404 status code.
 * You might be interested in another discussion on this matter. Turns out cache
   plugins play a significant part in this too. I’ve done quite a bit of research
   on this and posted my findings in the other discussion. I don’t want to overload
   this discussion by pasting all of the info over here too.
 * Here is the other discussion ==> [https://wordpress.org/support/topic/404-status-code-changes-to-200-after-first-hit-on-same-url/](https://wordpress.org/support/topic/404-status-code-changes-to-200-after-first-hit-on-same-url/)
 * ————
 * Hi [@thoughton](https://wordpress.org/support/users/thoughton/)
    It turns out
   my advice above to use the 404Page plugin in conjunction with this one (404 to
   301) is NOT a solution after all.
 * 2 problems arose:
    1 – Cache plugins serving up the error URL as 200 status 2–
   It very quickly STOPPED this plugin from working correctly
 * Apparently, my post above is now too old for me to be able to edit or delete 
   it.
 * Please see the link above to the other discussion to better understand the other
   issues that come into play on this.
 * Also, you can use [Bing Webmaster Tools](https://www.bing.com/toolbox/webmaster)
   to remove your unpublished pages and error URL’s from their index 🙂
 * ————
 * The more I dig into this issue, the more problems I’m finding in regards to WordPress
   properly handling 404’s in general. The problem is present in themes and plugins
   not handling it correctly.
 * You’d think by now WordPress would have a better solution for managing 404’s.
   As it is, WordPress and many themes DO have a 404 template that fires the 404
   status correctly. BUT most people are not able to properly set up their desired
   design and layout on them because it has to be hard-coded. There is no way to
   handle them in the page editor.
 * ————
 * Joel – [@joelcj91](https://wordpress.org/support/users/joelcj91/)
    Please do 
   let us know when you have this figured out.
 * I’d be happy to test it for you too before you release it 🙂
 * Thanks guys!!
    LL
 *  [thoughton](https://wordpress.org/support/users/thoughton/)
 * (@thoughton)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11458258)
 * Thanks [@leopard-lady](https://wordpress.org/support/users/leopard-lady/) I ended
   up putting this whole mess on hold for a while. The site I’m working on has has
   messed up 404s for over a year now, another week or two isn’t going to hurt.
 * I tried using your solution but had some other major issue with the 404page plugin.
   From memory the compatibility mode didn’t work with some versions of PHP? I can’t
   remember exactly. Anyway, it didn’t work.
 * Thanks for suggesting Bing Webmaster tools. I’ll have a look. The site in question
   has thousands of pages so I need some kind of automation.
    -  This reply was modified 7 years, 1 month ago by [thoughton](https://wordpress.org/support/users/thoughton/).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘does not return a 404 HTTP status code’ is closed to new replies.

 * ![](https://ps.w.org/404-to-301/assets/icon.svg?rev=3548123)
 * [404 to 301 - Redirect, Log and Notify 404 Errors](https://wordpress.org/plugins/404-to-301/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/404-to-301/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/404-to-301/)
 * [Active Topics](https://wordpress.org/support/plugin/404-to-301/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/404-to-301/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/404-to-301/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [thoughton](https://wordpress.org/support/users/thoughton/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/does-not-return-a-404-http-status-code/#post-11458258)
 * Status: not resolved