• Hi folks,

    Having a bit of trouble with my patterns. I don’t use them often, so I couldn’t say for sure when it broke, but the site is currently on WP 7. Seems similar to https://wordpress.org/support/topic/unable-to-insert-unsynced-patterns-in-posts-wordpress-7/ except I tried a user with editor permissions and still couldn’t insert an unsynced pattern.

    Anyway, I had a synced pattern that I wanted to use in a recent post with a few modifications. It’s basically just a button with custom classes and text/link on the button. So I created a duplicate of the pattern, but toggled it to unsynced. Made my edits and went back to edit the post, but neither the synced pattern or the unsynced show up in the My Patterns folder.

    If I type a / and then start typing part of the pattern name, I can get either to show up, but the unsynced pattern cannot be inserted. Clicking the name of the pattern does nothing (except change the color momentarily), and there are no relevant errors in the dev console.

    I tested duplicating to a new synced pattern, and I can insert that one similar to the original, but none of these three patterns show up in My Patterns, although they are all visible under Appearance->Patterns.

    I did disable all plugins and switched to Twenty Twenty, but still couldn’t insert the unsynced pattern.

    Here’s the raw HTML of the original pattern:

    <!-- wp:button {"className":"ewww-button aligncenter"} -->
    <div class="wp-block-button ewww-button aligncenter"><a class="wp-block-button__link wp-element-button" href="https://ewww.io/fake-link/" rel="">Fake Text!</a></div>
    <!-- /wp:button -->

    I did also try creating a new unsynced pattern, put a paragraph and button in there manually, and that one works just fine. So then I copied the above code into a new unsynced pattern, repeated my changes, and am unable to insert the new pattern.

    Maybe it’s just a bug and needs fixed?

    I compared the above with the new pattern that has a button, and it certainly looks different:

    <!-- wp:buttons -->
    <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"luminous-vivid-orange"} -->
    <div class="wp-block-button"><a class="wp-block-button__link has-luminous-vivid-orange-background-color has-background wp-element-button" href="https://ewww.io/fake-link/">Get Thingy</a></div>
    <!-- /wp:button --></div>
    <!-- /wp:buttons -->

    It does seem a little odd that the original has no “buttons” wrapper, not sure how it got like that exactly, but this partially-working state is just strange. Ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Shane Bishop

    (@nosilver4u)

    I did a completely fresh site/install, created a pattern with the code from my unsynced pattern (the one that won’t show up), and one with just a brand new button in it. When I type /button, both of them show up, but only the latter is clickable. And only the brand new button/pattern shows up under My Patterns in the post editor.

    Hi Shane,

    Thanks for the very detailed report that made it much easier to narrow down. Based on your tests (fresh install, default theme, no plugins, and the HTML comparison you posted), this looks like it’s related to a change introduced in WordPress 7.0, not a plugin/theme conflict.

    Here’s what’s likely happening:

    1. WordPress 7.0 expanded “contentOnly” editing mode to unsynced patterns and template parts. The Core team specifically flagged the Buttons block as one of the blocks that received targeted contentOnly changes and may behave differently than before.
    2. Your original pattern uses a standalone wp:button block without the standard wp:buttons wrapper <div class="wp-block-buttons">. This is valid block markup, but it’s not the structure WordPress normally generates (buttons are always inserted inside a wp:buttons group). It looks like the new contentOnly logic in 7.0 doesn’t handle this non-standard structure correctly, which is why the pattern shows up in the inserter but can’t actually be inserted.

    Steps to work around this while it gets confirmed as a bug:

    1. Edit your pattern’s HTML (via the Code editor / “Edit as HTML” option in the block editor, or Appearance -> Patterns -> your pattern -> Code editor) and wrap the button in a proper wp:buttons block, like this:
    <!-- wp:buttons -->
    <div class="wp-block-buttons"><!-- wp:button {"className":"ewww-button aligncenter"} -->
    <div class="wp-block-button ewww-button aligncenter"><a class="wp-block-button__link wp-element-button" href="https://ewww.io/fake-link/" rel="">Fake Text!</a></div>
    <!-- /wp:button --></div>
    <!-- /wp:buttons -->

    This matches the structure of your working pattern and should let it insert normally.

    1. If you’d rather keep testing the original structure, you can try disabling contentOnly mode for unsynced patterns via the new disableContentOnlyForUnsyncedPatterns block editor setting (added in 7.0), using the block_editor_settings_all filter. This is more of a debugging step than a permanent fix, but it will confirm whether contentOnly mode is indeed the cause.
    2. Since this reproduces on a fresh install with a default theme and no plugins, I’d recommend reporting it on the Gutenberg GitHub repo (https://github.com/WordPress/gutenberg/issues) with your exact HTML and reproduction steps — this looks like a genuine bug rather than something you can permanently fix on your end.

    Reference: Pattern Editing in WordPress 7.0 — Make WordPress Core: https://make.wordpress.org/core/2026/03/15/pattern-editing-in-wordpress-7-0/

    Let me know if wrapping the button in wp:buttons resolves it, that will help confirm the diagnosis!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.