Title: Not Excluding Specified Posts
Last modified: August 16, 2018

---

# Not Excluding Specified Posts

 *  Resolved [JohnNadeau](https://wordpress.org/support/users/johnnadeau/)
 * (@johnnadeau)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/not-excluding-specified-posts/)
 * Hi Jeremy,
 * Wondering if you might be able to help?
 * **We have two (very similar) web sites:**
    LakePath.com (real estate listings)
   LeLacAppelle.com (housing development)
 * **They are both running:**
    WordPress 4.9.8 Latest JetPack and All other Plugins
   REST API Post Embeds v1.4.1 Same TwentyFourteen Theme/Child_ (with a few minor
   exceptions)_ Same Plugins_ (with a few minor exceptions)_
 * **Overview/Issue:**
    LakePath pulls in Blog Posts from LeLac in the left sidebar.
   You helped me set it up for randomizing the posts every 10 minutes and it’s been
   working very nicely.
 * However, the _**Posts that I’ve excluded in the Widget Code continue to be displayed**_.
   I noticed this some time ago _(maybe 4+- months ago)_, but never looked into 
   it, so I don’t think it’s because of any recent WordPress or Plugin Updates.
 * When you get a chance, can you take a look at the Widget & Child/Function Code
   below and let me know what I’m missing?
 * As always, thanks in advance for any insight you might provide.
 * John
    ****************************************************************************
 * **ON LakePath.com Site:**
    **WIDGET**: Recent Posts From Le Lac Appelle… The 
   Lake Is Calling [jeherve_post_embed url=”lelacappelle.com” wpapi=true include_images
   =”true” order_by=”rand” number=”5″ image_size=”202,114″ include_credits=”false”
   include_excerpt=”false” category=”Lake Moments” exclude=890,1427,1580,1884]
 * **CHILD THEME FUNCTION.PHP:**
 *     ```
       /* JRN Note Changes default cache of 10 minutes to refresh posts */
       /* was 3. changed to 10 on 6/24/17 8:20am */
       function jeherve_custom_api_embeds_caching() {
       	return 10 * MINUTE_IN_SECONDS;
       }
       add_filter( 'jeherve_post_embed_posts_cache', 'jeherve_custom_api_embeds_caching' );
   
       /* JRN Note Jeremy had me add to fix rand sort */
   
       add_filter( 'rest_post_collection_params', 'my_prefix_add_rest_orderby_params', 10, 1 );
   
       function my_prefix_add_rest_orderby_params( $params ) {
           $params['orderby']['enum'][] = 'rand';
   
           return $params;
       }
       ```
   
 * *******************************************************************
 * **ON LeLacAppelle.com Site:**
 * **WIDGET**: _Not used at LeLac_
 * **CHILD THEME FUNCTIONS.PHP:**
 *     ```
       /* JRN Note Changes default cache of 10 minutes to refresh posts */
       /* was 3. changed to 10 on 6/24/17 8:20am */
       function jeherve_custom_api_embeds_caching() {
       	return 10 * MINUTE_IN_SECONDS;
       }
       add_filter( 'jeherve_post_embed_posts_cache', 'jeherve_custom_api_embeds_caching' );
   
       /* JRN Note Jeremy had me add to fix rand sort */
   
       add_filter( 'rest_post_collection_params', 'my_prefix_add_rest_orderby_params', 10, 1 );
   
       function my_prefix_add_rest_orderby_params( $params ) {
           $params['orderby']['enum'][] = 'rand';
   
           return $params;
       }
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnot-excluding-specified-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [7 years, 8 months ago](https://wordpress.org/support/topic/not-excluding-specified-posts/#post-10671311)
 * Sorry for the late reply.
 * That is unfortunately a known limitation of the WordPress REST
    API: the `post__not_in`
   parameter, used to exclude posts from a query, is only available for authenticated
   requests; my plugin does unauthenticated requests, and thus cannot exclude posts
   when you use the WordPress REST API option.
 * You can read more about this here:
    [https://github.com/WP-API/WP-API/issues/1357](https://github.com/WP-API/WP-API/issues/1357)
 *  Thread Starter [JohnNadeau](https://wordpress.org/support/users/johnnadeau/)
 * (@johnnadeau)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/not-excluding-specified-posts/#post-10673368)
 * Thank you Jeremy.
 * Good to know.
 * As always, I appreciate your help & insight!

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

The topic ‘Not Excluding Specified Posts’ is closed to new replies.

 * ![](https://ps.w.org/rest-api-post-embeds/assets/icon.svg?rev=2495828)
 * [REST API Post Embeds](https://wordpress.org/plugins/rest-api-post-embeds/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rest-api-post-embeds/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rest-api-post-embeds/)
 * [Active Topics](https://wordpress.org/support/plugin/rest-api-post-embeds/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rest-api-post-embeds/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rest-api-post-embeds/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [JohnNadeau](https://wordpress.org/support/users/johnnadeau/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/not-excluding-specified-posts/#post-10673368)
 * Status: resolved