Skip to content

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

Closed

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

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Jan 27, 2026
  2. added
    Needs TestingNeeds further testing to be confirmed.
    [Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.
    on Jan 27, 2026
  3. huzaifaalmesbah commented on Jan 27, 2026

    @huzaifaalmesbah
    Member

    Reproduction Report

    Environment

    • WordPress: 6.9
    • PHP: 8.2.30
    • Server: nginx/1.29.4
    • Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
    • Browser: Chrome 143.0.0.0
    • OS: macOS
    • Theme: Twenty Twenty-Five Child
    • MU Plugins: None activated
    • Plugins:
      • Test Reports 1.2.1
      • Gutenberg 22.4.1 (tested separately, see notes below)

    Steps taken

    1. Activated the Twenty Twenty-Five theme and created a child theme.
    2. Checked Patterns → Call to Action before adding any code.
      • Total patterns before code: 20
    3. Added the following code to the child theme’s functions.php file:
    function my_theme_setup() {
        // REMOVE CORE WP PATTERNS
        remove_theme_support( 'core-block-patterns' );
    }
    add_action( 'after_setup_theme', 'my_theme_setup' );
    1. Also tested the alternative snippet:
    add_action( 'init', function() {
        remove_theme_support( 'core-block-patterns' );
    });
    1. Refreshed the editor and checked Patterns → Call to Action again.

      • Total patterns after code: 13
    2. Created a new page in the block editor.

    3. Clicked the (+) inserter to add a block or pattern.

    4. Repeated all steps:

      • With no plugins active
      • With Gutenberg plugin 22.4.1 active

    x. ❌ Bug is not occurring

    Expected behavior

    • Core WordPress block patterns should be removed from the inserter when remove_theme_support( 'core-block-patterns' ); is used in the Twenty Twenty-Five theme or its child theme.

    Additional Notes

    • I was unable to reproduce the reported issue.
    • The Call to Action category was reduced from 20 patterns to 13 patterns, confirming that core patterns are being removed.
    • The removal of core block patterns works as expected in all tested scenarios.
    • Tested specifically with the Twenty Twenty-Five child theme.
    • Behavior is the same with and without the Gutenberg plugin.

    Screenshots/Screencast with results

    https://files.catbox.moe/ulh54g.mp4

  4. bradhogan commented on Jan 27, 2026

    @bradhogan
    Author

    @huzaifaalmesbah Ah, yes you are correct. Okay, so the default theme just has THAT many patterns built-into it and no way of removing those patterns from the default Twenty Twenty Five theme then I suppose? Not the end of the world, but it would be nice if the default theme had no patterns imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions