Integrating WordPress into a non-wordpress Site

Hi — this tip is for anyone using both wordpress and non-wordpress pages on the same site.

If you’d like to use a wordpress plugin on non-wp pages, or have anything in functions.php tell the non-wp pages what to do — e.g. display a different result from amazon depending on which folder they’re in (see — then on all the non-wordpress pages:

(1) add this at the top before doctype:

where “../” is the path to root folder (public_html) where wp-blog-header.php is.

(2) add this in last line before you close

(3) add this before you close

Some sites and even codex ( will tell you to just add this at the top (in addition to wp_head & wp_footer):

BUT if you do this (leave out the status_header and nocache lines) then WP will return a 404 error on the non-WP pages to bots like googlebot and xml-sitemaps. Essentially all your non-WP pages become invisible to googlebot. Only user browsers will still see them.

WP thinks that the non-WP page is a WP internal URL (because of wp-blog-header) and after it cannot find it internally, returns status code 404 although the page loads fine. So a human being sees it, but a bot sees the 404.

I learned the hard way!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s