WordPress Changing HTML Code

  • Unknown's avatar

    I keep typing in my own code into the custom HTML only for WordPress to change/delete it. How can I stop this form happening?

  • Hello there,

    Many thanks for reaching out.

    Can you tell us more about the HTML you’re to use please?

    Many thanks in advance.

  • Unknown's avatar

    I’m trying to use the <details> tag

    I type the following into the custom HTML block:

    <details>
    <summary>HEADING TITLE</summary>

    MY CODE

    </details>

    When I preview the page, it looks how it’s supposed to look. But, when I save, exit the page, and return it deletes all of MY CODE, just leaving the following:

    <details>
    <summary>HEADING TITLE</summary>

    </details>

  • Hey there,

    There is some embed code that will not work because we do not allow certain tags on WordPress.com, for security reasons, including JavaScript, Flash, iframe, form, and input tags. But, we do allow the details and summary tag. Hmm…can you provide the URL of the page with the HTML block?

  • Unknown's avatar

    I’m still working on the site but here is a link to a test page. I did the same custom HTML block the way I normally do

    Test Page

  • Would you please share the code you’re trying here?

    Make sure you use the “code” button above when replying.

  • Unknown's avatar

    `<!– wp:jetpack/layout-grid {“column1DesktopSpan”:3,”column1DesktopOffset”:2,”column1TabletSpan”:4,”column1MobileSpan”:4,”column2DesktopSpan”:3,”column2DesktopOffset”:2,”column2TabletSpan”:4,”column2MobileSpan”:4,”column3DesktopOffset”:3,”className”:”column1-desktop-grid__span-3 column1-desktop-grid__start-3 column1-desktop-grid__row-1 column2-desktop-grid__span-3 column2-desktop-grid__start-8 column2-desktop-grid__row-1 column1-tablet-grid__span-4 column1-tablet-grid__row-1 column2-tablet-grid__span-4 column2-tablet-grid__start-5 column2-tablet-grid__row-1 column1-mobile-grid__span-4 column1-mobile-grid__row-1 column2-mobile-grid__span-4 column2-mobile-grid__row-2″} –>
    <div class=”wp-block-jetpack-layout-grid alignfull column1-desktop-grid__span-3 column1-desktop-grid__start-3 column1-desktop-grid__row-1 column2-desktop-grid__span-3 column2-desktop-grid__start-8 column2-desktop-grid__row-1 column1-tablet-grid__span-4 column1-tablet-grid__row-1 column2-tablet-grid__span-4 column2-tablet-grid__start-5 column2-tablet-grid__row-1 column1-mobile-grid__span-4 column1-mobile-grid__row-1 column2-mobile-grid__span-4 column2-mobile-grid__row-2″><!– wp:jetpack/layout-grid-column –>
    <div class=”wp-block-jetpack-layout-grid-column wp-block-jetpack-layout-grid__padding-none”><!– wp:spacer –>
    <div style=”height:100px” aria-hidden=”true” class=”wp-block-spacer”></div>
    <!– /wp:spacer –>

    <!– wp:image {“id”:105,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image size-large”><img src=”https://cfstestsites822771773.files.wordpress.com/2021/02/cover-eval-of-cfs.png?w=732″ alt=”” class=”wp-image-105″/></figure>
    <!– /wp:image –>

    <!– wp:heading {“level”:4,”className”:”margin-bottom-half”} –>
    <h4 class=”margin-bottom-half”>Evaluation of Child-Friendly Spaces</h4>
    <!– /wp:heading –>

    <!– wp:paragraph {“className”:”margin-top-half”,”fontSize”:”small”} –>
    <p class=”margin-top-half has-small-font-size”>Description</p>
    <!– /wp:paragraph –>

    <!– wp:spacer –>
    <div style=”height:100px” aria-hidden=”true” class=”wp-block-spacer”></div>
    <!– /wp:spacer –>

    <!– wp:image {“id”:101,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image size-large”><img src=”https://cfstestsites822771773.files.wordpress.com/2021/02/cover-reception-centres.png?w=726″ alt=”” class=”wp-image-101″/></figure>
    <!– /wp:image –>

    <!– wp:heading {“level”:4,”className”:”margin-bottom-half”} –>
    <h4 class=”margin-bottom-half”>Child Friendly Spaces in Reception Centres</h4>
    <!– /wp:heading –>

    <!– wp:paragraph {“className”:”margin-top-half”,”fontSize”:”small”} –>
    <p class=”margin-top-half has-small-font-size”>Description</p>
    <!– /wp:paragraph –></div>
    <!– /wp:jetpack/layout-grid-column –>

    <!– wp:jetpack/layout-grid-column –>
    <div class=”wp-block-jetpack-layout-grid-column wp-block-jetpack-layout-grid__padding-none”><!– wp:image {“id”:104,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image size-large”><img src=”https://cfstestsites822771773.files.wordpress.com/2021/02/cover-operational-guidance.png?w=683″ alt=”” class=”wp-image-104″/></figure>
    <!– /wp:image –>

    <!– wp:heading {“level”:4,”className”:”margin-bottom-half”} –>
    <h4 class=”margin-bottom-half”>Operational Guidance for Child-Friendly Centers in Humanitarian Settings</h4>
    <!– /wp:heading –>

    <!– wp:paragraph {“className”:”margin-top-half”,”fontSize”:”small”} –>
    <p class=”margin-top-half has-small-font-size”>Description</p>
    <!– /wp:paragraph –>

    <!– wp:spacer –>
    <div style=”height:100px” aria-hidden=”true” class=”wp-block-spacer”></div>
    <!– /wp:spacer –>

    <!– wp:image {“id”:103,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image size-large”><img src=”https://cfstestsites822771773.files.wordpress.com/2021/02/cover-guidelines-for-cfs.png?w=784″ alt=”” class=”wp-image-103″/></figure>
    <!– /wp:image –>

    <!– wp:heading {“level”:4,”className”:”margin-bottom-half”} –>
    <h4 class=”margin-bottom-half”>Guidelines for Child Friendly Spaces in Emergencies</h4>
    <!– /wp:heading –>

    <!– wp:paragraph {“className”:”margin-top-half”,”fontSize”:”small”} –>
    <p class=”margin-top-half has-small-font-size”>Description</p>
    <!– /wp:paragraph –></div>
    <!– /wp:jetpack/layout-grid-column –></div>
    <!– /wp:jetpack/layout-grid –>

  • Thanks, I’m assuming that’s not the HTML you’re putting in the block though, right?

    I took a look at the page and saw two HTML blocks. One of them was asking to attempt block recovery; I took a look and the html was missing a closing tag. I fixed that.

    Can you let us know just what you’re putting in the HTML blocks that’s getting stripped out?

  • The topic ‘WordPress Changing HTML Code’ is closed to new replies.