Classipress is a great wordpress theme-classifieds ads platform. With it, you have to option to set a schedule when a particular ad will expire and subsequently deleted. It is a really great feature but it will also result to several error 404 pages when a particular page or posting is already indexed by the search engine.

There are several wordpress plugins to manage error for redirection but I find the easy way to do it is to change the Classipress default 404. Simply replace the Classipress 404.php code with the code below;
<?php
header(“Status: 301 Moved Permanently”);
header(“Location:http://www.yoursite.com”);
?>
Yes, it’s a simple code and there you go. Every time a deleted post will come out in the search engine result and visitors click on it, they will be redirected to the homepage.



it didnt work for me
it says …
syntax error unexpected on line 2
This works like a dream … note you need to change the quotation marks (“) in the code above to be proper quotation marks (“) or it won’t work as with the comment above
)