From a03cb8b96d2e721749ee58545a92d23b7af033a8 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 07:02:08 +0000 Subject: [PATCH 1/2] docs(customization-free): Document new wpseo_bulk_editor_excluded_post_types filter Introduced in 28.1-RC5. New public filter allows developers to control which post types appear in the Yoast SEO bulk editor. Default exclusion list is ['attachment']. --- .../bulk-editor-excluded-post-types-filter.md | 54 +++++++++++++++++++ sidebars.js | 1 + 2 files changed, 55 insertions(+) create mode 100644 docs/customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter.md 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..a6fddbf8 --- /dev/null +++ b/docs/customization/yoast-seo/filters/bulk-editor-excluded-post-types-filter.md @@ -0,0 +1,54 @@ +--- +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' ); +``` + +### Including the attachment post type + +To make attachments available in the bulk editor, remove `attachment` from the exclusion list: + +```php + $excluded_post_types Post types currently excluded from the bulk editor. + * + * @return array The updated list of excluded post types. + */ +function my_include_attachments_in_bulk_editor( $excluded_post_types ) { + return array_diff( $excluded_post_types, [ 'attachment' ] ); +} + +add_filter( 'wpseo_bulk_editor_excluded_post_types', 'my_include_attachments_in_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", ], }, { From a2c6833455a1ab741bc77dddb5c22eb8ec375ead Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Thu, 16 Jul 2026 11:14:03 +0300 Subject: [PATCH 2/2] Apply suggestion from @leonidasmi --- .../bulk-editor-excluded-post-types-filter.md | 20 ------------------- 1 file changed, 20 deletions(-) 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 index a6fddbf8..7b47e342 100644 --- 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 @@ -32,23 +32,3 @@ function my_exclude_product_from_bulk_editor( $excluded_post_types ) { add_filter( 'wpseo_bulk_editor_excluded_post_types', 'my_exclude_product_from_bulk_editor' ); ``` -### Including the attachment post type - -To make attachments available in the bulk editor, remove `attachment` from the exclusion list: - -```php - $excluded_post_types Post types currently excluded from the bulk editor. - * - * @return array The updated list of excluded post types. - */ -function my_include_attachments_in_bulk_editor( $excluded_post_types ) { - return array_diff( $excluded_post_types, [ 'attachment' ] ); -} - -add_filter( 'wpseo_bulk_editor_excluded_post_types', 'my_include_attachments_in_bulk_editor' ); -```