MB Include Exclude is an official extension of the Meta Box ecosystem that allows WordPress developers to show or hide meta boxes conditionally based on precise location rules. Designed for those building complex sites with multiple content types, this tool solves a recurring problem: controlling exactly on which pages, posts, or admin panel sections each meta box appears.
The extension works through include and exclude configuration parameters that are added directly to the definition of each meta box. From there, the developer can define conditions based on post IDs, parent page IDs, slugs, page templates, categories, tags, custom taxonomies, user roles, user IDs, and even custom functions written in PHP. Conditions can be combined using the logical operators AND or OR, allowing you to create rules as simple or as complex as the project requires.
Among its most notable capabilities are filtering by custom taxonomies, detection of child pages with the is_child parameter, and the ability to define custom verification functions using the custom parameter, which receives the meta box array as an argument and returns a boolean value. It is also compatible with the MB User Meta extension for advanced conditions based on roles and edited users.
This extension is ideal for developers managing sites with specific page templates, blogs with differentiated categories, or projects where different user profiles must see different sets of fields. By reducing clutter in the admin panel and showing only the fields relevant to each context, it improves the editing experience and minimizes configuration errors.
MB Include Exclude integrates natively with the Meta Box plugin, and its official documentation includes complete code examples to implement both inclusion and exclusion rules. It is the perfect solution for those seeking granular, programmatic control over the visibility of their meta boxes in WordPress.