• Resolved tbyrne

    (@tbyrne)


    Hi, Im wondering if there is a way to 301 redirect the job URLs of expired jobs without doing them individually. Is there a setting or a script I can add that once the job is expired we can 301 the URL to the jobs main page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @tbyrne
    just add this snippet to your (child)themes functions.php

    add_action( 'wp', function() {
    	global $post;
    	if ( ! is_singular( 'job_listing' ) || empty( $post ) || 'job_listing' !== $post->post_type ) {
    		return;
    	}
    	if ( 'expired' === $post->post_status ) {
    		wp_redirect( 'https://www.example.com' );
    		exit;
    	}
    } );
    • This reply was modified 3 years, 1 month ago by braehler.
    Plugin Support Jay

    (@bluejay77)

    Hi @tbyrne,

    It has been more than one week since we have heard from you, so I’m marking this topic as resolved.

    But if you have any further questions or need some more help, you’re welcome to reply here or open another thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘301 expired jobs’ is closed to new replies.