Handling expired listings and SEO in HivePress

Hi, I’m using HivePress with the ExpertHive theme and need help properly implementing the handling of expired listings. I want to avoid mass 404 errors when a listing expires and make sure Google correctly understands its status. Ideally, once a listing expires, it should remain visible for a while with a message like “This listing has expired,” be excluded from search results (via meta noindex), and then after a few days be removed completely with a 410 (Gone) response — or at least not return a 404 error that could affect SEO. What’s the best way to implement this flow in HivePress, including templates, custom statuses, or cron automation? Has anyone solved this before or could guide me on how to do it properly within the HivePress structure?

Hi,

Thanks for the details and feedback. Please note that this feature is not available in this version; it will require custom implementation.

You can try to customize this by catching the single listings Page and replacing the 404 code in $wp_query, as described here Trigger 404 template from a filter - sage - Roots Discourse, and vice versa. This way, you can replace the content.

1 Like

Can you explain this to me in more detail? I don’t understand what I should do.

Chatgpt recommendation:
I recommend implementing three key functions to handle expired ads SEO-safely:

  1. Expiration Check & Override: Hook into template_include to detect if a listing (hp_listing or hp_request) has passed its hp_expired_time meta, then override the template instead of serving a 404, clear the 404 flag in $wp_query, and emit either 200 + <meta name="robots" content="noindex,follow"> (soft phase) or 410 Gone (hard phase).
  2. Grace-Period Flagging: Use a cron job or a save_post hook to mark expired items with a custom flag (_hp_should_410) once they’ve exceeded your grace period, so you can switch from soft to hard 404 behavior.
  3. Custom Expired Template: Provide a dedicated expired-ad.php in your theme (or plugin) that displays a user-friendly, Spanish‐localized “This ad has expired” message with links to active listings, replacing the default error page.

This approach mirrors how Fiverr and Upwork avoid mass 404s—by first serving a noindex “expired” page and only later returning 410 Gone—so you preserve SEO value and user experience.

I don’t know how to code, so I’m hoping your SEO extension already supports this or that you can explain the best way to do it with HivePress and ExpertHive.

Hi,

Please note that we can only provide basic recommendations. If you need help with customization, I recommend hiring an expert: Customize your website | HivePress

1 Like

Hi,

Thanks for the reply. But honestly, I don’t think this should be considered just a customization. I already purchased the HivePress SEO extension to avoid issues like this, and I was surprised it doesn’t include something as basic as handling 404 errors for expired listings.

In a marketplace, this kind of issue can turn into a serious SEO problem over time. Doing everything manually with a redirection plugin is not practical or scalable. That’s why I really think you should at least provide a basic guide or snippet to help us handle this properly from the start.

I’d really appreciate it if you could point me in the right direction to set this up correctly.

1 Like

Hi,

Thanks for the details. Please note that we have provided you with general guidance, as this functionality is not yet available in our extension. Unfortunately, we cannot provide more detailed information from our support team, as coding is not within the scope of our support Support Policy | HivePress.

If you need this feature urgently and you are not familiar with coding or do not have a developer, the best option is to hire an expert or wait for an update from us.