Need help with embedding a Youtube subs count (urgent)

  • Unknown's avatar

    Hello.

    I am creating a wordpress for professional purposes and it needs to be operational quickly. However, I am failing to embed a live count of a youtuber’s subscribers, which is vital for what I want to do.

    When I paste the embedding HTML code, it works just fine in the edit page (see here https://i.imgur.com/adG0AOI.png ) but on the actual wordpress blog, it is a mere hypertext link. Why does it work when I am editing it and stops working afterward, and how can I fix it?

    Thanks in advance.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi,

    Unfortunately it’s not possible to add any iFrames to WordPress.COM sites, due to security reasons.

    WordPress.com allows the following HTML code in your posts, pages, and widgets:

    address, a, abbr, acronym, area, article, aside, b, big, blockquote, br, caption, cite, class, code, col, del, details, dd, div, dl, dt, em, figure, figcaption, footer, font, h1, h2, h3, h4, h5, h6, header, hgroup, hr, i, img, ins, kbd, li, map, ol, p, pre, q, s, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var

    If you are familiar with HTML, you’ll notice that codes such as embed, frame, iframe, form, input, object, textarea and others are missing from the above list. Those codes are not allowed on WordPress.com for security reasons.

    Source: https://en.support.wordpress.com/code/#html-tags

    Alternatively you could embed a screenshot of your YouTube Subscriber Count in your blog post and update it periodically.

    Hope this helps!

  • Unknown's avatar

    Thanks for your answer!

    However, I cannot really afford to make screenshots every few minutes for months just because the iframe code doesn’t work… Do you think there is any automated alternative, such as converting the iframe code into one of the ones WordPress recognizes? Also, the iframe codes does work in the edit window, surely there must be a way to make it work in the final product no?

  • Unknown's avatar

    iframes are not supported on WordPressdotcom as @seasonschangecc mentioned, with the exception of those vetted and approved sources which are converted to work, like some Google map or calendar embeds. It’s unlikely that a private utility like the one you are linking to will be approved.

    If you don’t wish to use a screen capture, you could possibly add an image button or text link like “Click here for Live Stats” instead.

    It is odd that the iframe appears in the Visual Editor tab after adding the iframe to the HTML Editor tab (and updates!), so I’ve tagged this for Staff input.

  • Unknown's avatar

    Hi michat2,

    iframes are not supported here on WordPress.com — this is to protect the security of your site.

    it works just fine in the edit page (see here https://i.imgur.com/adG0AOI.png ) but on the actual wordpress blog

    Unsupported code formats such as iframes are stripped out once a post/page/widget has been published, which is why it is only visible when you are editing.

    If you wish to to find out which code formats are supported, have a look at this page:

    Add Code to Your Site

    We also have some information about how you can use YouTube videos on your site:

    https://en.support.wordpress.com/videos/youtube/

    Come back to me if you have any questions.

  • Unknown's avatar

    Thanks for the explanation @gemmacevans

    michat2 was looking to embed a utility that shows the live follower count on a YouTube account, not a YouTube video itself. :)

  • The topic ‘Need help with embedding a Youtube subs count (urgent)’ is closed to new replies.