• Resolved akoya

    (@akoya)


    I’ve noticed that HTML anchors are added also to (some) Paragraphs. This is obviously unnecessary and when trying to remove it, it’s added again automatically.
    When removing the plugin, the issue is resolved.

    Setup:
    WordPress 5.8.3
    Genesis with Child theme
    Gutenberg

    Is this known/expected and/or is there a fix for this?

    Best,

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter akoya

    (@akoya)

    Should be added that the ID added has no max length, so it will contain the entire paragraph unless edited manually (which would require setting a unique ID for each paragraph which is ofc pointless)

    Bug results in a unncessary big DOM + poor SEO optimization.

    Plugin Contributor Chris Hadley

    (@chrishadley)

    Hi @akoya

    Thanks for your message.

    I’ve had a a look at the link you provided but I unfortunately can’t see the issue. Could you post some screenshots of the DOM to demonstrate the issue?

    Kind regards,

    Chris

    @akoya it seems i don t have this issue on my side too, could you explain ?

    I see this with WP 5.9 / Yoast 18.0, where anchors are added automatically to all header blocks. The anchor text can be modified / shortened, but with this setting, eliminating a header anchor instantly re-fills it with the default text. This particularly hurts with the “Yoast Table of Contents” block. Up to WP 5.8.3 / Yoast pre-18, one could simply eliminate the anchor text in the sidebar widget. I’m trying to get this fixed through Yoast.

    Thread Starter akoya

    (@akoya)

    Sorry for the late reply. As this was on a live site I had to deactivate the plugin. It’s still live on this site:

    https://paraslataus.fi/latausasemat/easee/

    Check the DOM for the paragraph under ‘Tekniset ominaisuudet’
    I just removed the the HMTL anchor but it’s automatically replaced with:

    htoc-alla-n-et-latausaseman-t-ydelliset-tekniset-tiedot-jos-olet-ep-varma-jonkin-kohdan-merkityksest-voit-lukea-lis-sivustoltamme

    My response above may seem unrelated, as I don’t use the “Heroic Table of Contents” plugin —?however: the issues appear to be related. In my case, the issues is not with the Yoast SEO plug (i.e., their TOC block), but with WP, or rather with a recent change to the Gutenberg plugin, which automatically adds anchors to all header blocks. In your case, you may have inherited this through a Gutenberg plugin update, while in my case I ran into this through the WP 5.9 update which again has incorporated recent changes to Gutenberg.
    Automatic addition of HTML anchors to header blocks may be a good idea —?but it definitely needs an option to opt out for individual blocks. My workaround is to switch from header block to a plain paragraph, and to style that like a header. That’s not a universal solution, of course: for one, it’s clumsy, and then, converting headers to paragraphs may destroy your readability score (e.g., with Yoast SEO).
    And a personal advice: don’t “abuse” header blocks for bold text / highlighting —?rather style a plain paragraph to make it look the way you want. In WP 5.8.3, you could probably deactivate the Gutenberg plugin to avoid the issue, but in WP 5.9, this would not help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘HTML anchors added to automatically’ is closed to new replies.