Title: Shortcode excluding selected post id&#8217;s?
Last modified: March 29, 2019

---

# Shortcode excluding selected post id’s?

 *  Resolved [Jimmy Lee](https://wordpress.org/support/users/shirtguy72/)
 * (@shirtguy72)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/shortcode-excluding-selected-post-ids/)
 * Maybe I’m just tired? I have tried reading all the doc’s…My theme is only allowing
   the shortcode, which is fine, I must say, the shortcode in a widget after content
   works and looks wonderful, but I want to use the shortcode to exclude certain
   post ID’s … Is this possible?

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

 *  Plugin Author [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/shortcode-excluding-selected-post-ids/#post-11369311)
 * Good morning, I hope you had a good sleep! 😉
 * The [button shortcode](https://documentation.chattymango.com/documentation/redirect-url-to-post/getting-started-redirect-url-to-post/redirect-button/)
   can receive additional parameters through “params”. The old format (…=>…) stopped
   working in the widgets, so I had to change it.
 * In order to exclude posts, the following should work: (using [exclude](https://documentation.chattymango.com/documentation/redirect-url-to-post/getting-started-redirect-url-to-post/search-parameters/)
   with post IDs)
 * `[redirect_to_post_button redirect_to="latest" params="exclude=1,2,3"]`
 *  Thread Starter [Jimmy Lee](https://wordpress.org/support/users/shirtguy72/)
 * (@shirtguy72)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/shortcode-excluding-selected-post-ids/#post-11370552)
 * Good morning, could have been longer, thanks! Firstly want to thank you for your
   time in helping! I have updated the plugin, pasted an exact copy (post numbers
   differ) of your shortcode suggestion, added rule to Cloudflare, changed cache
   settings on Cloudflare, un-ticked Remove query strings from static resources 
   in Autoptimize and have tried every possible combination of said settings. I 
   can’t get her to work. The basic shortcode still works fine but adding the params
   only redirects to the same post over and over.
 *  Plugin Author [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/shortcode-excluding-selected-post-ids/#post-11370850)
 * That shortcode is supposed to redirect to the most recent post (excluding those
   IDs that you added). What exactly do you want to achieve? If you want a random
   post, you need
 * `[redirect_to_post_button redirect_to="random" params="exclude=1,2,3"]`

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

The topic ‘Shortcode excluding selected post id’s?’ is closed to new replies.

 * ![](https://ps.w.org/redirect-url-to-post/assets/icon-256x256.png?rev=1742449)
 * [Random Post Plugin - Redirect URL to Post](https://wordpress.org/plugins/redirect-url-to-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirect-url-to-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirect-url-to-post/)
 * [Active Topics](https://wordpress.org/support/plugin/redirect-url-to-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirect-url-to-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirect-url-to-post/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Christoph](https://wordpress.org/support/users/camthor/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/shortcode-excluding-selected-post-ids/#post-11370850)
 * Status: resolved