• Whenever I paste a youtube link, I can see in visual (if using Yoast SEO) that the embed is displayed OK. When I post it, I simply see the actual link (inactive) only.

    If I try to use an embed code, it is stripped. I have tested with disabling other plugins, still the same result.

    Testing with a vanilla site without Yoast SEO, the iframe is stripped too and the link also displays as inactive. Of course, in this case we have no Visual environment to test if it embeds before posting.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Is this a stand-alone WordPress site, or is it a subsite in a WordPress multisite network?

    If it’s a stand-alone WordPress site, do you have an administrar or editor role on the site in question?

    I’m trying to see whether you have the unfiltered_html capability or not, without which the behaviour you’re seeing should be expected.

    Thread Starter spiros

    (@spiros)

    stand-alone, self-hosted, admin, yes.

    I just spun up a new WordPress sandbox site to test this: default Twenty Twenty-Two theme and no plugin active.

    And YouTube embedding worked: Youtube block, pasting link into paragraph block, and iframe embed code in Custom HTML block all worked.

    So it seems your issue is local to your setup: perhaps a theme or plugin conflict.

    Thread Starter spiros

    (@spiros)

    Are you sure you did that in the category description section and not a post/page? There are no blocks in category description.

    Please forgive me: I missed that part in your title.

    By default, WordPress strips out all (but the most basic) HTML tags from the category (and taxonomy) descriptions.

    You can allow HTML tags via this plugin or custom code like this or this or this (note that the three custom code links remove different filters!).

    Sorry again.

    Thread Starter spiros

    (@spiros)

    Oh no worries! Thank you so much. By the way, what if I simply want to enable oembed as in standard posts?

    By the way, Allow HTML in Category Descriptions, does not allow youtube iframes. The other solutions appear not to affect it either.

    • This reply was modified 2 years, 4 months ago by spiros.
    • This reply was modified 2 years, 4 months ago by spiros.
    • This reply was modified 2 years, 4 months ago by spiros.
    Thread Starter spiros

    (@spiros)

    I found it

    add_filter( 'term_description', array( $GLOBALS['wp_embed'], 'autoembed' ) );

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display a YouTube video in the category description’ is closed to new replies.