Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Disable the core block AND post patterns

  • Via the block inserter > patterns dialogue.
    I’d like to disable the core block patterns.
    So I only see GenerateBlocks patterns that I’ve added myself.

    I found this code, but I’m not a php expert, is this code safe to run? I tested it using the Code Snippets plugin you suggest and it appears to work OK.

    https://wordpress.org/support/topic/feature-request-disable-core-block-patterns/

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

    Also.
    The code above removes the core block patterns.
    BUT the core post patterns still display via the block inserter > patterns dialogue.

    Is there a way to disable the core POST patterns too please?

  • Hi there,

    that snippet is safe to run, its using the core functionality for disabling patterns.
    And it should remove them for everywhere, do they still appear in the block inserter if you log out and log back in ?

  • No, they don’t reappear after logging out and in.

    By post patterns I mean default WordPress query loop blocks under a tab called posts.

    I think these are default WordPress patterns.

    They display when using default WordPress themes (or GeneratePress) via the block inserter > patterns dialogue > (Scroll down to) Posts (patterns).

    Is it possible to remove these too please?

  • Ah ok, so the Post patterns and the CTA patterns are linked to the core Query Loop and Social Icon blocks. So if you disable those blocks in the preferences those patterns should go away.

  • Thanks David, I…

    I went to Edit Page > Options (three dots top right) > Preferences (bottom tab).
    Selected the Blocks tab: then disabled (unticked) – Widgets > Social Icons and – Theme > Query loop.

    Combined with the code snippet above, this made the Inserter > Patterns dialogue much cleaner, especially for non-techie end users.

    Thank you.

  • Glad to be of help

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.