Leaving pages accessible with a "this product is not available" message has the potential to make your site appear low-quality to search engines. If search engines send traffic to such page, users will tend to see that the product isn't available, hit the back button to go back to the the search results, and select a different site. I've seen that having a high bounce-back-rate can have a disastrous effect on SEO.
Redirecting the pages to the home page is problematic for both usability and SEO. From a usability standpoint, users don't find the content they wanted and your home page is unlikely feature similar enough content to satisfy them (like the same model and size of tire for which they were searching.) Search engines treat redirects to the home page like a 404 error and stop indexing the content of the page without passing any link juice to your home page. Google calls home page redirects "soft 404 errors."
The best thing that you can do for users is show them a list of the most similar current content:
These P225/70R16 97H tires were already sold, but here are available tires that will fit your vehicle.
- link to other similar classified ad
- Another link to another similar classified ad
Once you have that functionality you have two options for search engines:
- Leave the content of the original classified ad accessible forever, but put the list of similar links above it so that users have something to do other than hitting the back button.
- Remove the content and return a "410 Gone" HTTP status with a custom error page showing the list of similar links.
The first option will allow the pages to be indexed by search engines. That could be OK if a significant portion of the users that land on the page are satisfied by the other classified ads in your similar list.
The second option prevents search engines from indexing the old content so that it can't hurt your current content.
unavailable_aftertag if you want content to disappear from search results at a known date in the future. It could help prevent stale results from showing in search until Google recrawls them. Ex:
<meta name="robots" content="unavailable_after: 2020-11-16">