• Resolved Don Matteo

    (@donkeyshark)


    I use TSF 3.2.4 on WP 5.2, may suddenly appear tags in title, can also have happened earlier, I noticed it yesterday, the issue happens always with 3 and more characters in uppercase in titles, like <span class=“caps”>XYZ</span>, even the option Remove HTML-Tags from generated titles is activated.

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    Upon inspection, I suspect someone entered the title like that in the Post SEO Settings field, found below the content-editor. Alternatively, it could’ve been transferred over like that from another SEO plugin.

    The option you’ve toggled only works for auto-generated output, which leads me to this conclusion.

    Could you double-check those fields, and see if editing it resolves the issue you’re facing?

    Cheers 🙂

    Thread Starter Don Matteo

    (@donkeyshark)

    Hi Sybre

    Thanks for your quick reply.

    The following tests are established!
    if I disable the TSF plugin, all titles are clean.
    if I enter the same Post title in the editor SEO title field, the title come clean.
    if I leave the Post SEO title field empty (auto-generated), tags appear in the title.

    When editing the SEO title field with uppercase letters it comes fine, so only if leave the field blank the tags come up, this with always the same <span class=”caps”>XYZ</span>

    Greetings
    (Don)

    Thread Starter Don Matteo

    (@donkeyshark)

    I found it, it is caused by another plugin, the wp-Typography plugin from Peter Putzer generate tags in title along with TSF, may there is an attitude to avoid it, I will check the plugin settings.

    Thread Starter Don Matteo

    (@donkeyshark)

    The final solution!

    Remove tags in title are possible with adjustment in the wp-Typography plugin settings, go to page css-classes and disable Acronyms (in block letters), this will disapper tags in title.

    (Don)

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Don,

    I’m glad you’ve found the solution! Awesome 🙂

    @pputzer would you like to look into this issue? I suggest preventing spawning HTML tags in process_title_parts() by filtering the settings.

    @cybr, @donkeyshark Can you explain the issue to me, are we talking about the <title> tag or the various headings (<h1> to <h6>)? For the latter, the canonical solution is to use the_title_attribute function when a HTML-free value is needed.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Peter,

    Thanks for dropping by!

    The issue is the title tags get HTML enhancements that add extraneous tags. For example:

    
    <!-- Before: -->
    <title>Some string more text</title>
    <!-- After: -->
    <title>Some string <span class=“caps”>more text</span></title>
    

    Thanks, @cybr. That’s a bug for sure.

    @cybr: I’ve tried to reproduce this and it only happens when SEO Framework is installed. So it’s not wp-Typography adding the markup to the <title> tag but SEO Framework building its own title string and applying various filters intended for other contexts (like single_post_title). So it is actually a bug in SEO Framework: you should not assume that post titles intended for display in headings are free of HTML tags.

    Thread Starter Don Matteo

    (@donkeyshark)

    @pputzer @cybr I already described such behavior here in this thread, I also wrote about wp-Typography settings, I deactivate the option, Caps: Wrap acronyms (all capitals) with <span class”caps”>, that disapper tags in title. So it can be corrected with a wp-Typography settings, I can’t rate it whether it has to be aware of it.

    So that solved the problem for me.

    (Don)

    • This reply was modified 4 years, 11 months ago by Don Matteo.
    • This reply was modified 4 years, 11 months ago by Don Matteo.

    @donkeyshark Yes, but that disables the feature for the entire site. The reason that the markup gets injected into the <title> tag is SEO Frameworks way of generating the title parts. The underlying cause needs to be fixed there.

    Plugin Author Sybre Waaijer

    (@cybr)

    @pputzer could you please reassess your findings? The example you’ve given is also used in WordPress’ default document title output.

    Reference:

    1. Title output functions:
    • Both use: single_post_title()
    • The SEO Framework’s title generation is a copy of the aforementioned WordPress title-tag functions, but with added admin-screen mimicking support.

      The HTML-supported function for titles is the_title(), and, in extent, get_the_title(). However, support for that is also inconsistent, as some themes and templates wrap esc_html() around that.

      I hope this helps!

    Edit: Feeling a bit stupid, because I didn’t see what the actual problem was. The SEO Framework does not run the standard WordPress filter hooks (document_title_parts and wp_title_parts). I was actually stripping out the tags myself all along.

    Not applying those filters still counts as a SEO Framework bug, though.

    • This reply was modified 4 years, 11 months ago by pepe.
    Plugin Author Sybre Waaijer

    (@cybr)

    This has become a dev-centric talk, and I’m glad you’ve forwarded it to GitHub, @pputzer!

    https://github.com/mundschenk-at/wp-typography/issues/246
    https://github.com/sybrew/the-seo-framework/issues/436

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘title with tags’ is closed to new replies.