• Is it possible to publish a post that doesn’t show up in feed nor on the blog’s first page?

    I would like to have a post that only people who I gave the permalink to had access, but I don’t want it to be password protected.

    Is is possible?

    How do I do it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I need to know the answer to this as well.

    I want to write a disclaimer so it will look like a normal post but not appear in feed or front page.

    There must be a way of doing that?

    Thread Starter rafaelperrone

    (@rafaelperrone)

    Well, I waited until I have posted another 10 posts and published it with a later date. Since my feed only shows the 10 last posts, it didn’t show up in the feed nor the front page.

    To exclude a post from feeds, create a category for that post and use this code in your functions file (if the category is 39, for instance):

    function myFilter($query) {
    	if ($query->is_feed) {
    		$query->set('cat','-39');
    	}
    
    return $query;
    }
    
    add_filter('pre_get_posts','myFilter');

    To exclude it from the front page, you can fudge the date, as you suggested. Or you could use the sideblog plugin, which will exclude posts from the main page, but they will still display as individual posts or in the category page. (With the sideblog plugin you can also exclude a category from feeds with just a checkmark.)
    https://www.ads-software.com/extend/plugins/sideblog/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Publishing a post that doens’t show up in feed’ is closed to new replies.