• When I paste any text content That contains [] in the block editor, then it automatically converts to a Shortcode block.

    How to stop this behavior or fix this bug?

    Example: when i paste below content in block editor.

    [code]sudo apt install cmake[/code]

    It automatically convert to shortcode block like below image.

Viewing 3 replies - 1 through 3 (of 3 total)
  • How to stop this behavior or fix this bug?

    This is not happening for me on a fresh 6.4.1 test site with the default Twenty Twenty-Four theme and NO plugin active.

    Perhaps the issue is coming from whatever you have installed that’s processing your [code] custom shortcode. In my test, WordPress treated it as raw text in a paragraph block, since I don't have anything processing this shortcode.

    Hi @atharvan,

    I understand that you are having a problem with the block editor that keeps converting any content to a Shortcode block.

    By default, WordPress interprets any content that is placed in the block editor as plain text within a paragraph block, as long that you haven’t specified what type of block you are going to use.

    Normally, such behavior comes from a 3rd-party plugin. Therefore, isolation is your best approach in this case.

    You can deactivate each of your active plugins and check if the issue still happening in between deactivation.

    If the suggestion above does not resolve the problem, then try switching your theme to the default WordPress theme (Twenty Twenty-Four).

    Best regards,
    Robert

    I can also confirm that both the post editor and site editor on the fresh WP 6.4 install don’t convert [code]sudo apt install cmake[/code] automatically into the Shortcode block.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fix Auto Shortcode Block Conversion’ is closed to new replies.