WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a WordPress site that includes pages pulled from a different database. The problem is that these other pages return a 404 status code. (The WordPress posts/pages are fine.)

The 404'ed pages display fine, and I removed the "Page not Found" text from the title tag in WordPress. But Googlebot and W3C see the 404 header.

So: wow does one tell Apache to suppress a 404 status? And will Apache override WordPress's 404 header?

Does that make sense? What other info and things should I be looking at?

Can I suppress the status code in .htaccess so I don't change WP core files?

share|improve this question

migrated from stackoverflow.com Sep 26 '12 at 12:59

This question came from our site for professional and enthusiast programmers.

up vote 10 down vote accepted

You can either add custom rewrites to your pages. Or on the top of the template files that wrap your other pages just output header('HTTP/1.1 200 OK');.

share|improve this answer
Great fix rather than using .htaccess and for fixing just the non-WP php page templates. Thanks! – markratledge Jun 14 '10 at 17:28

WordPress offers the function status_header() to return the correct status-code.

You can call this function inside your WordPress template/function:

// Will return http status header "200 OK"
share|improve this answer

Wordpress is PHP, so look for where it's sending something like:

header("HTTP/1.0 404 Not Found");
share|improve this answer
Accidently downvoted you, but changed it. I'd rather not change WP core files. – markratledge Jun 14 '10 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.