Part 10 of 13 · Job Board

A Job Board Has to Keep Itself Alive

A job board rots by default, every listing carries a closing date, and a board still showing last month’s expired jobs is lying to every visitor who clicks one. The other quiet failure is invisibility, hundreds of job pages search engines never discover. This post is the pair of systems that fought both, the expiry checker and the plugin’s own XML sitemap.

Expiry first. Every imported job stores its closing date, and a daily check finds the dead:

function jab_check_expired() {
    $expired = get_posts(array(
        'post_type'   => 'jab_job',
        'post_status' => 'publish',
        'numberposts' => -1,
        'fields'      => 'ids',
        'meta_query'  => array(array(
            'key'     => '_jab_close_date',
            'value'   => current_time('Y-m-d'),
            'compare' => '<',
            'type'    => 'DATE',
        )),
    ));
    if ($expired) {
        update_option('jab_expired_pending', $expired);  // surfaced as a notice
    }
}

The design choice worth defending, expired jobs are not auto-deleted, the checker surfaces them as a dashboard notification asking before removal, because automation that destroys content should ask the first hundred times, the human-gate philosophy one more time, and because sometimes closings extend and a deleted job is history lost.

Discoverability got its own machinery, a sitemap system the plugin serves at /sitemap.xml, an index pointing to per-type sub-sitemaps, pages, posts, and the jab_job type, so every job page is announced rather than waiting to be stumbled upon:

add_action('init', function () {
    add_rewrite_rule('^sitemap.xml$', 'index.php?jab_sitemap=index', 'top');
    add_rewrite_rule('^sitemap-([a-z_]+).xml$', 'index.php?jab_sitemap=$matches[1]', 'top');
});
// the renderer prints an urlset of permalinks with lastmod from post_modified

The two systems are one strategy seen from both ends, the sitemap tells search engines these pages exist, freshness makes sure what they find is alive, and lastmod dates from real modification times tie them together, a board that updates daily and says so is exactly what a jobs vertical wants to crawl. The alternative in each direction is a slow poison, stale listings burn visitors one click at a time, and undiscovered pages mean the whole ingestion pipeline feeds an audience of nobody.

A few things people ask me about this

Should expired jobs be deleted, drafted, or noindexed? Surfaced first, then removed or drafted on confirmation. Keeping expired listings public with a closed notice suits archives, but a board selling freshness should clear them promptly, deliberately.

Why serve a custom sitemap instead of relying on an SEO plugin? Control over inclusion and structure for the custom type, an index plus sub-sitemaps with real lastmod. If your SEO plugin already covers CPTs correctly, use it, mine needed guarantees.

Next

One healthy source made a healthy board, and the ceiling was visible, one source, one niche. Tearing the engine open to accept many sources at once is the next post.

Leave a Reply

Your email address will not be published. Required fields are marked *