Title: Exclude single posts
Last modified: August 24, 2016

---

# Exclude single posts

 *  Resolved [betagoo](https://wordpress.org/support/users/betagoo/)
 * (@betagoo)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/exclude-single-posts/)
 * How to **exclude few single posts** by ID from category menu?
    I tried to use
   skip parametr, but this skip for example 3 first posts from category. This parametr
   set offset argument. How to add **exclude** argument?
 * [https://wordpress.org/plugins/category-posts-in-custom-menu/](https://wordpress.org/plugins/category-posts-in-custom-menu/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168480)
 * Hi betagoo,
 * there is currently no parameter to exclude posts by ID from the menu.
    Note that
   the plugin was not created with this in mind and, at this moment, you should 
   do this by creating a new category and assigning the posts you want in the menu
   to this new category.
 * As for fine-grained control, as soon as you start excluding one post at a time,
   it’s a small step from just manually adding the posts you want to the menu. This
   goes against what the plugin intends to do.
 * If, of course, a significant amount of users want this functionality, I’ll reconsider.
   So anyone who also wants this, feel free to speak up.
 * Kind regards,
    Diana
 *  Thread Starter [betagoo](https://wordpress.org/support/users/betagoo/)
 * (@betagoo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168490)
 * There is solution;
 * After line 71 add code:
    `delete_post_meta($nav_menu_item->ID, 'cpcm-item-exclude');`
 * After line 217 add code:
    `$query_arr['exclude'] = get_post_meta($menu_item->
   db_id, "cpcm-item-exclude", true); // default value of 0 skips no posts`
 * After line 358 add code:
    `update_post_meta( $menu_item_db_id, 'cpcm-item-exclude',(
   int) ($this->__empty( $_POST['menu-item-cpcm-item-exclude'][$menu_item_db_id])?"-
   1" : $_POST['menu-item-cpcm-item-exclude'][$menu_item_db_id]) );`
 * After line 522 add code:
 *     ```
       <p class="field-cpcm-item-exclude description description-thin">
       		                    <label for="edit-menu-item-cpcm-item-exclude-<?php echo $item_id; ?>">
       			                    <?php _e( 'Exclude Posts' ); ?><br />
       			                    <input type="text" id="edit-menu-item-cpcm-item-exclude-<?php echo $item_id; ?>" class="widefat code edit-menu-item-cpcm-item-exclude" name="menu-item-cpcm-item-exclude[<?php echo $item_id; ?>]" value="<?php $item_exclude = get_post_meta($item_id, "cpcm-item-exclude", true); echo $item_exclude != '' ? $item_exclude : '0'; ?>" />
       		                    </label>
       	                    </p>
       ```
   
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168504)
 * Hi betagoo,
 * I hope you’ll understand that I’m reluctant to fill my plugin with each and every
   option that everyone asks of me. Ask yourself: is this option useful for everyone?
   Right now, I must conclude no.
 * However, I’ve received a similar request via e-mail (i.e. adding of a custom 
   option) and I would like to come up with an elegant way in which users can add
   their own custom fields to the plugin. I will look into this.
 * Kind regards,
    Diana
 *  Thread Starter [betagoo](https://wordpress.org/support/users/betagoo/)
 * (@betagoo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168510)
 * I understand.
    Thank You very much.
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168547)
 * Hi betagoo,
 * I’ve just finished implementing support for extensions. The latest Development
   Version of my plugin, which you can grab on the development page, now includes
   an additional action hook and filter, so that CPCM can be extended.
 * I have included a sample plugin that extends CPCM in exactly the way you want.
 * Would you be willing to grab the latest development version and give CPCM and
   the sample plugin a test run?
 * Kind regards,
    Diana
 *  Thread Starter [betagoo](https://wordpress.org/support/users/betagoo/)
 * (@betagoo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168552)
 * Works great.
    Both methods, as plugin and as code into functions.php Thank You
   wery much.
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168553)
 * Hi betagoo,
 * thanks a lot for trying out and reporting back! Next release version will contain
   this functionality 🙂
    Note that I’d like some more feedback on other new functionality
   before I release it, but it’s on its way!
 * Kind regards,
    Diana

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Exclude single posts’ is closed to new replies.

 * ![](https://ps.w.org/category-posts-in-custom-menu/assets/icon-128x128.png?rev
   =2539336)
 * [Category Posts in Custom Menu](https://wordpress.org/plugins/category-posts-in-custom-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/category-posts-in-custom-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/category-posts-in-custom-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/exclude-single-posts/#post-6168553)
 * Status: resolved