Skip to content

Cannot remove core patterns when using Twenty Twenty Five theme (or child theme) #74959

@bradhogan

Description

@bradhogan

Description

The following code directly in the Twenty Twenty Five theme's functions.php file or in a child theme for the Twenty Twenty Five theme does not remove the core patterns. We need a way to remove core patterns from the default theme. Cheers!

function my_theme_setup() {
    // REMOVE CORE WP PATTERNS
    remove_theme_support( 'core-block-patterns' );
}
add_action( 'after_setup_theme', 'my_theme_setup' );

Also does not work:

add_action('init', function() {
    remove_theme_support('core-block-patterns');
});

Step-by-step reproduction instructions

Add one or both of the above snippets to a child theme for the Twenty Twenty Five theme with no other plugins installed and then add a new page, click the (+) to add a block or pattern, see the core patterns are still present.

Screenshots, screen recording, code snippet

No response

Environment info

  • wp 6.9
  • latest gutenberg (also happens without)
  • chrome
  • mac

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions