WordPress.org

Ready to get started?Download WordPress

Forums

Publishing a post that doens't show up in feed (4 posts)

  1. rafaelperrone
    Member
    Posted 5 years ago #

    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?

  2. alphawave
    Member
    Posted 5 years ago #

    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?

  3. rafaelperrone
    Member
    Posted 5 years ago #

    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.

  4. asfodel
    Member
    Posted 5 years ago #

    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.)
    http://wordpress.org/extend/plugins/sideblog/

Topic Closed

This topic has been closed to new replies.

About this Topic