Disable links / embed in basic textarea / text type attributes

Hi there!

I have an issue with formatting for the different field attributes. You said in the community (Don't allow links in listing description) that html will always be transformed into plain text, but URLs and links are converted to links however I have a vendor who just added links and they get transformed really weirdly automatically. Instead of a clickable link it is transformed into a different new format with borders and strange bigger text. It is some kind of embed I guess.

Out of privacy reasons I don’t want to put in the same url the vendor used in my case, but the url just looks like “https://thevendorsdomain.com/imprint”. Just that, nothing else.

Here is what this url looks like on the front end:

Even though it is a plain text fields without any customization whatsoever, it turns automatically into this weirdly styled clickable link. And there’s also this huge whitespace area which isn’t there when you put in plain text. It’s super weird.

You said the formatting happens because of make_clickable() | Function | WordPress Developer Resources.

I need to remove/disable this function. Could you please provide a code that disables formatting of embeds/urls please?

There are several more reasons why this formatting needs to be disabled on my site.

Thank you

Hi,

Please try using the code snippet suggested here How to Disable Embeds in WordPress (without a Plugin) - WP Pagebuilders You can also use this condition in it to use this code for the listing page only:

if(is_singular('hp_listing')) {
//... code here
}

I tried the codes provided on that page but unfortunately nothing changed.

Any ideas?

This is the code that’s generated automatically when adding the vendor’s url to the textarea field:

<figure class="wp-block-embed wp-has-aspect-ratio wp-embed-aspect-16-9">
<div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="JU3BTIkk6Z"><p><a href="https://thevendorsdomain.com/imprint/">Imprint</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="„Imprint“ — Vendor" src="https://thevendorsdomain.com/imprint/embed/#?secret=1ssmht4eQt#?secret=JU3BTIkk6L" data-secret="JU3BTIkk6L" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p></div>
</figure>

Maybe this help you analyze what’s going on here?

Thank you for your efforts

Hi,

Please try this PHP snippet:

remove_filter( 'the_content', [ $GLOBALS['wp_embed'], 'autoembed' ], 8 );

1 Like

Thank you mate, that worked perfectly!

1 Like