Im trying to replace all 404 error code with 410 gone request which is good for SEO
I have tried the following snippet from TheDevBlog Post
if ( is_404() ) {
define( 'DONOTCACHEPAGE', true ); // WP Super Cache and W3 Total Cache recognise this
status_header( 410 ); }
This is not working, i have checked the syntax & they are correct, why is it not working? what am i missing?
2
Answers
You also need to add 410.php to your theme directory.
You can create 410.php and copy the page template to see the result.
Here what you are looking to achieve.
This will replace all 404 status to 410 .