On my site, people can link to non-existing posts, which is fine because that’s the whole structure on my site… The problem is that you get 404 errors, which is not good for SEO. Is there a way in WordPress to avoid 404 pages? So if a post not exists, that you can do else instead of sending to Google that it’s a 404 page?
2 comments
Comments are closed.
One way to do this is to use the status_header filter. Adding the following to the functions.php file or your theme (or an appropriate plugin file) would do the trick:
Alternately, you could add
@header( $_SERVER[ 'SERVER_PROTOCOL' ] . ' 202 Accepted', true, 202 );
to your 404.php file before theget_header()
call.The downside to this is that all 404s will be returned as 202, including legitimate Files Not Found.
Users will still be served the 404.php template, so add your create post form there and you should be good.
Permalink Finder Plugin serves that purpose.