• I’m encountering some odd behaviour while trying to add a specific URL to a post (plain text, no href or other code). I’m using the Classic Editor plugin but I think the error occurs with Gutenberg too.

    The problem link:

    https://www.naacp.org/

    When the above text is added to a post or page, WordPress seems to change it automatically, putting the word “Home” inside a blockquote instead of showing the URL. Here’s the code it adds:

    <blockquote class="wp-embedded-content" data-secret="xxxxxxxxxx"><p><a href="https://www.naacp.org/">Home</a></p></blockquote>
    <p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="“Home” — NAACP" src="https://www.naacp.org/embed/#?secret=xxxxxxxxxx" data-secret="xxxxxxxxxx" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>

    I’ve tested this on several WordPress sites and the results are the same each time, although the secret value changes. Removing https:// will allow the text to be rendered correctly, but I need to accurately quote a press release which contains the full URL. How can I stop WP from adding all that extra stuff?

    • This topic was modified 4 years, 8 months ago by gorky5.
    • This topic was modified 4 years, 8 months ago by gorky5.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Here you go :

    <blockquote class="wp-embedded-content" data-secret="xxxxxxxxxx"><p><a href="https://www.naacp.org/">https://www.naacp.org/</a></p></blockquote>
    <p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="“Home” — NAACP" src="https://www.naacp.org/embed/#?secret=xxxxxxxxxx" data-secret="xxxxxxxxxx" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>

    Just replace this part with the direct link to your post :
    <a>https://www.naacp.org/url-directly-to-post</strong>"><strong>text to link to post</strong></a>

    Thread Starter gorky5

    (@gorky5)

    That doesn’t really solve the issue though. WordPress shouldn’t be adding all that extra crap to a plain text link, and should treat all links and text consistently.

    Thread Starter gorky5

    (@gorky5)

    To be clear, though, this is the only URL I’ve ever encountered which gets converted in this way (in a blockquote with the “Home” text). It doesn’t seem to matter whether or not the Gutenberg editor is in use.

    It’s more than just a plain text link being converted to an active link too – it seems to be a bug unique to this particular URL. Try it – put…

    https://www.naacp.org/

    …on its own line in a draft page or post, and preview or publish.

    Yes, I did try it! Which is how I found out how annoying this is.
    TBH I’ve rarely used the Gutenberg editor for anything.
    For me, it does it for both these different URLs :
    https://nghapoe.ca/consensus/

    Crazy annoying.

    Thread Starter gorky5

    (@gorky5)

    Damn, I didn’t realise there were others.

    I don’t use the Gutenberg editor either, though I did briefly enable it to check that the NAACP link behaved the same way.

    Thanks for your input. Hopefully someone from the WP dev team can chime in and let us know what’s going on. I really hope it’s a bug and not a “feature”.

    If you read this reply, I’m guessing it’s a feature :
    https://www.ads-software.com/support/topic/paste-links-in-gutenberg-without-embedding/#post-11865013

    If you were using it consistently, I would recommend adding a hook and filter to the editor. But it’s just a one off, I wouldn’t bother.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem adding naacp.org link to posts’ is closed to new replies.