Title: Exclude posts
Last modified: August 21, 2016

---

# Exclude posts

 *  [steve-acet](https://wordpress.org/support/users/steve-acet/)
 * (@steve-acet)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts/)
 * Is there an easy way for a list of child post ID’s to be passed via the shortcode
   to exclude from appearing in the list?
 * [https://wordpress.org/plugins/child-pages-shortcode/](https://wordpress.org/plugins/child-pages-shortcode/)

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

 *  [mapdi](https://wordpress.org/support/users/mapdi/)
 * (@mapdi)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/exclude-posts/#post-5140874)
 * Is there any solution for this request? I would like to exclude a page ID, too.
 *  [dooza](https://wordpress.org/support/users/dooza/)
 * (@dooza)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/exclude-posts/#post-5140875)
 * Its actually fairly easy, this is my shortcode, hopefully you will see what I
   have done: [http://pastebin.com/dLcxuvtz](http://pastebin.com/dLcxuvtz)
 * You need to add the exclude parameter in the first part, then use “post__not_in”
   in your query.
 * Cheers,
 * Steve
 *  [mapdi](https://wordpress.org/support/users/mapdi/)
 * (@mapdi)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/exclude-posts/#post-5140878)
 * Hi Steve,
    thanks for your code, but unfortunately its not easy for mee .. 🙁
   could you pls be a little more specific how to add the exclude paramater and 
   how to use “post__not_in” in the query (of this plugin)?
 * Like this?
 *     ```
       <?php
           // default args
           $args = array(
             	'exclude' => ''
           );
   
           add_filters('child-pages-shortcode-query', "my_query");
           function my_query($args) {
               'post__not_in'	=> explode(",",$exclude)
       	);
               return $args;
           }
       ?>
       ```
   
 * [https://wordpress.org/plugins/child-pages-shortcode/](https://wordpress.org/plugins/child-pages-shortcode/)
 * Thank in advance.
 * Cheers,
    John
 *  [dooza](https://wordpress.org/support/users/dooza/)
 * (@dooza)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/exclude-posts/#post-5140879)
 * Sorry, I didn’t use the plugin in the end, I created my own shortcode and put
   it in my functions file. This led me to be able to style it exactly as my site
   needed it.
 * Steve

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/child-pages-shortcode_1b95bb.svg)
 * [Child Pages Shortcode](https://wordpress.org/plugins/child-pages-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/child-pages-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/child-pages-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/child-pages-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/child-pages-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [dooza](https://wordpress.org/support/users/dooza/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/exclude-posts/#post-5140879)
 * Status: not resolved