Title: Exclude post from WP API
Last modified: July 26, 2021

---

# Exclude post from WP API

 *  Resolved [zubovd](https://wordpress.org/support/users/zubovd/)
 * (@zubovd)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/)
 * I found that in version 1.5 the $query->is_main_query() condition was removed
   and now records are also excluded from WP API requests.
 * if i add to IF section – $query->is_main_query()
    then everything is fine as 
   before.
 * fix this please, because I need to exclude posts on the front page, but not in
   the REST API.

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

 *  Plugin Author [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * (@marios-alexandrou)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/#post-14703115)
 * What’s a design flaw for some people is a feature for others. However, if you’d
   like to submit code that enables the user to toggle functionality on and off 
   so that the plugin satisfies all users, feel free to do so.
 *  [atchoooo](https://wordpress.org/support/users/atchoooo/)
 * (@atchoooo)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/#post-14727653)
 * This is a change that BROKE our web site which relies on the WordPress API. Because
   just like that the default post call started to exclude our categories that are
   excluded from homepage. Previous behavior was that posts were NOT excluded from
   the API calls. You can’t just decide to change the behavior without offering 
   a way to turn it off if it’s not backward compatible.
 * Furthermore it seems there’s something wrong because even when we completely 
   delete category excluder from our plugins the API still excludes the category
   that was excluded with category excluder! So far we did not find a way to get
   the API post call to return posts from ALL categories as it always did.
 * Where do you tell wordpress to exclude the categories from the API call? And 
   why would this setting remain even after removing category-excluder?
 *  [atchoooo](https://wordpress.org/support/users/atchoooo/)
 * (@atchoooo)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/#post-14727655)
 * Same request for me here:
 * Fix this please, because I need to exclude posts on the front page, but not in
   the REST API and by doing so you broke our web sites.
 *  Plugin Author [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * (@marios-alexandrou)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/#post-14728182)
 * The plugin doesn’t interact with the WordPress API specifically. All it does 
   is check things like is_home, is_feed, is_search, and is_archive.
 * In addition, if the plugin is disabled and the problem persists, then I’d say
   the problem isn’t related to the plugin.

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

The topic ‘Exclude post from WP API’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-category-excluder/assets/icon-256x256.png?rev=1352232)
 * [Ultimate Category Excluder](https://wordpress.org/plugins/ultimate-category-excluder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-category-excluder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-category-excluder/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-category-excluder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-category-excluder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-category-excluder/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/exclude-post-from-wp-api/#post-14728182)
 * Status: resolved