• Resolved lindaomid

    (@lindaomid)


    Please I would like to disable the RSS feed in WP Job Manager.

    I copied the below code into my site’s function.php and still got no solution.

    add_filter( 'job_manager_job_filters_showing_jobs_links', 'custom_job_manager_job_filters_showing_jobs_links' );
    function custom_job_manager_job_filters_showing_jobs_links( $links ) {
    unset( $links['rss_link'] );
    return $links;
    }

    After inserting the code into the function.php page, I checked the RSS feed (my-site-domain.com/feed) to see if the code worked, but instead of seeing a message like this – No feed is available, the RSS field is still visible.
    Please assist me.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @lindaomid,

    It looks like that snippet we have is outdated, sorry for the trouble on that!

    This should send the RSS feed to a 404:

    add_action( 'template_redirect', 'disable_wpjm_job_feed' );
    
    function disable_wpjm_job_feed() {
    	$post_type = 'job_listing';
    
    	if ( is_feed() && get_post_type() === $post_type ) {
    		global $wp_query;
    		$wp_query->set_404();
    		status_header(404);
    		header('Content-Type: text/html; charset=utf-8');
    		get_template_part( 404 ); 
    		exit();
    	}
    }

    If you have any other questions, give us a shout!

    Thread Starter lindaomid

    (@lindaomid)

    Thank you so much for everything you do for us all. I appreciate your effort and support always.

    I didn’t see this code on time. I had already used function disable_rss_feed() {
    wp_die(‘Sorry, no RSS feed available.) and it worked. The RSS is now disabled. Please do you think I still need to use the code you wrote above?
    Looking forward to your response.
    Thank you very much.

    Plugin Contributor Cena (a11n)

    (@cena)

    Hi @lindaomid ,

    The primary difference between our snippet and the disable_rss_feed() function you used is that our snippet specifically only disables the feed for jobs.

    The disable_rss_feed() function disables your entire WordPress feed. If that’s okay, then no reason to change anything.

    See also: https://www.wpbeginner.com/wp-tutorials/how-to-disable-rss-feeds-in-wordpress/

    Please note that we recommend placing these snippets in a plugin like Code Snippets rather than directly in your functions.php, as a) any theme update will override the snippet (that wont happen in Code Snippets), and if you enter any bad/incorrect/etc code, Code Snippets will ensure your site doesn’t crash.

    Best,

    Thread Starter lindaomid

    (@lindaomid)

    Thank you very much. Issues solved.

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @lindaomid

    Excellent, I’m glad this is fixed for you.

    I’m going to mark this thread as resolved. If you have additional questions about WP Job Manager in the future, feel free to open a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disabling the RSS feed in WP Job Manager’ is closed to new replies.