Question

I'm tryying to prevent search engines from indexing my 404 page which is in a template called 404.php. I do not create an actual page, I simply rely on the php template for my 404 errors.

I'm using the code below and it's not working, I'm unsure what the best way to go about this is and I would appreciate help.

<?php if(is_single('404.php')): ?>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" />
<?php endif; ?>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top