diff --git a/docs/customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter.md b/docs/customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter.md new file mode 100644 index 00000000..7b47e342 --- /dev/null +++ b/docs/customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter.md @@ -0,0 +1,34 @@ +--- +id: bulk-editor-excluded-post-types-filter +title: "Yoast SEO: Exclude post types from the bulk editor" +sidebar_label: Exclude post types from the bulk editor +--- + +The Yoast SEO bulk editor (located at **SEO → Tools → Bulk editor**) lets you edit SEO titles and meta descriptions for multiple posts at once. By default, the `attachment` post type is excluded from the bulk editor. + +The `wpseo_bulk_editor_excluded_post_types` filter lets you change which post types are excluded. The filter receives the current exclusion list as an `array` of post type names and must return an `array`. + +## Usage + +### Excluding additional post types + +The example below excludes the `product` post type in addition to the default `attachment` exclusion. + +```php + $excluded_post_types Post types currently excluded from the bulk editor. + * + * @return array The updated list of excluded post types. + */ +function my_exclude_product_from_bulk_editor( $excluded_post_types ) { + $excluded_post_types[] = 'product'; + return $excluded_post_types; +} + +add_filter( 'wpseo_bulk_editor_excluded_post_types', 'my_exclude_product_from_bulk_editor' ); +``` + diff --git a/sidebars.js b/sidebars.js index 217c3a09..015f74cf 100644 --- a/sidebars.js +++ b/sidebars.js @@ -361,6 +361,7 @@ module.exports = { "customization/yoast-seo/wp-get-environment-type-in-yoast-seo", "customization/yoast-seo/filters/disable-opcache-reset-on-upgrade", "customization/yoast-seo/filters/custom-fields-pre-query-filter", + "customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter", ], }, {