Archived topic
Deactivate automatic Youtube imbedding
8 replies · Started by hari on February 28, 2016
Hi Tom,
maybe this is a dumb question, but I cant find a solution as everyone seems to *want* that Links to Youtube Videos are automatically framed and shown.
Unfortunately, I want the opposite. I want, that Links stay just Links, as long as I dont decide explicitly something else.
My basic understanding is, that this automatic embedding is a funktion of the wordpress editor, but I am not sure, if and if yes how, the theme might be involved too.
Simple question: Is there an easy way to deactivate all automatic embedding -either in Wordpress or in Generate Press - so that Links stay Links until explcitely stated otherwise?
If there is somewhere some type of "basic checkmark" in wordpress, that all others know, just myself not, I already apologize for the dumb question. ;)
Thanks, Hari
Hi Hari,
You can try something like this:
remove_filter( 'the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
Or a plugin like this: https://wordpress.org/plugins/disable-embeds/
Ahhh a plugin!
Will try that, thanks Tom!
You're welcome :)
Hmm, plugin doenst work. Although installed, youtube links are still automatically embedded.
And CSS above does not work either.
I still copy the URL of a youtube-video into the editor and it shows the video embedded instead of the link.
Maybe the theme has an influence here?
To add, i tried above CSS via the "Simple Customs CSS" plugin and not directly in the functions.php
It should be added as PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Thanks Tom, it worked via Code Snippets!
Beside, I still dont understand and dont accept why Wordpress removed! the option to deactivate this function. In some countries even legal problems for wordpress admins result from this, as a link is just a link, but an embedded video is legally seen, as if you would publish it yourself - meaning possible copyright issues are yours, as if you would have illegally copied the content.
I personally dont like the whole direction Wordpress is going. Lots and lots of more function, but less and less influence by the user -> bloatware.
Lucky that you provide us with such a fine theme, that at least in its own area allows a lot of tweaking with options.
Thanks again!
Hari
Most of their options come after tons of discussion which you can be apart of in their core Slack channel :)
Luckily almost everything they do can be reversed with some simple code like the above.
