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 If you're in this folder then display this - #27 by valarcher) – then on all the non-wordpress pages:
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.
That’s interesting and I will try it out sometime, but I don’t really understand in what situation you would use this. What do you mean by a non-WordPress page?
Wouldn’t it just be easier to have a WordPress site that contains both static and dynamic pages, with their headers, footers and skeleton structures always the same?. The difference comes basically in the content area where the ‘non-WordPress’ page would have static html instead of a loop to pull in content from the database. This seems to me to be much less complicated.
Hi - a non-wordpress page is a page written in html or php, not in wordpress.
I just posted that tip for google to pick up for people like myself who’ve built up a site over years – starting long before wordpress ever came on the scene! – and who are searching for a way to integrate wordpress plugins or functions.php into the non-wordpress pages of their site. For us, it’s just too much hassle to move over two decades of work into wordpress! But at the same time wordpress has some cool things - like a testimonials plugin - which are great to use.
Not if your site already has 2000 pages before you add WordPress.
I recently converted a 100 page non-WordPress site to WordPress and just converting the pages took about 25 hours once I made the changes needed for them to work properly in WordPress - particularly the ones with complex PHP or JavaScript in them.
Thanks guys for detailing what non-wordpress means so google is more likely to pick this up! Also I see an error in my original post, it should read like this:
(2) add this in last line before you close </head>