• Resolved Ahmed Elgameel

    (@elgameel)


    Hi everyone,
    I’ve 3 WordPress websites.
    After upgrading to WordPress 5.3.0, all embedded YouTube videos on all websites disappeared.
    In the editor, the YouTube block returns this error Sorry, this content could not be embedded.

    In WP editor, Chrome console shows this error when I click “Embed”:

    api-fetch.min.js?ver=3.6.4:1 GET https://website.com/wp-json/oembed/1.0/proxy?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvtIIKU2e1rU&_locale=user 404
    N @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    s @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    forEach.t.<computed> @ api-fetch.min.js?ver=3.6.4:1
    n @ api-fetch.min.js?ver=3.6.4:1
    c @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    w @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    i @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    O @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    i @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    e @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    L @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    (anonymous) @ api-fetch.min.js?ver=3.6.4:1
    M @ api-fetch.min.js?ver=3.6.4:1
    API_FETCH @ core-data.min.js?ver=2.7.4:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    e @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    c @ redux-routine.min.js?ver=3.6.2:1
    t @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    s @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    forEach.t.<computed> @ data.min.js?ver=4.9.2:1
    n @ data.min.js?ver=4.9.2:1
    c @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    q @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    s @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    forEach.t.<computed> @ data.min.js?ver=4.9.2:1
    n @ data.min.js?ver=4.9.2:1
    c @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    s @ data.min.js?ver=4.9.2:1
    a @ data.min.js?ver=4.9.2:1
    u @ data.min.js?ver=4.9.2:1
    (anonymous) @ block-library.min.js?ver=2.9.5:8
    (anonymous) @ data.min.js?ver=4.9.2:1
    t @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    o @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    p @ data.min.js?ver=4.9.2:1
    (anonymous) @ redux-routine.min.js?ver=3.6.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    (anonymous) @ data.min.js?ver=4.9.2:1
    tryAgain @ block-library.min.js?ver=2.9.5:8
    (anonymous) @ data.min.js?ver=4.9.2:1
    Vh @ react-dom.min.js?ver=16.9.0:163
    Uh @ react-dom.min.js?ver=16.9.0:14
    Xh @ react-dom.min.js?ver=16.9.0:14
    af @ react-dom.min.js?ver=16.9.0:14
    Yh @ react-dom.min.js?ver=16.9.0:164
    nd @ react-dom.min.js?ver=16.9.0:15
    nc @ react-dom.min.js?ver=16.9.0:15
    Of @ react-dom.min.js?ver=16.9.0:38
    Ac @ react-dom.min.js?ver=16.9.0:39
    unstable_runWithPriority @ react.min.js?ver=16.9.0:26
    Ma @ react-dom.min.js?ver=16.9.0:52
    Be @ react-dom.min.js?ver=16.9.0:119
    xi @ react-dom.min.js?ver=16.9.0:39
    Show 60 more frames
    

    and this is the return
    {"code":"rest_forbidden","message":"\u0639\u0641\u0648\u064b\u0627 \u063a\u064a\u0631 \u0645\u0633\u0645\u0648\u062d \u0644\u0643 \u0628\u0639\u0645\u0644 \u0637\u0644\u0628\u0627\u062a \u0639\u0644\u0649 oEmbed.","data":{"status":401}}

    of this WP-JSON url:
    https://website.com/wp-json/oembed/1.0/proxy?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvtIIKU2e1rU&_locale=user

    I’ve created a staging site, disabled all plugins, used Twenty Twenty theme and reinstalled WordPress. Yet, the problem still exists!

    WordPress version: 5.3.0
    Hosting provider: Cloudways
    Active plugins: 0
    Theme: Twenty Twenty (default theme)

    Any idea how to fix this issue?
    Thanks in advance.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter Ahmed Elgameel

    (@elgameel)

    The problem was solved.
    For the record, the issue was with Varnish caching wp-settings-* cookies although I was excluding them.

    madhumurthy

    (@madhumurthy)

    Hi!

    Maybe one of the solutions in this post might help.

    https://abdallamuse.com/how-to-fix-wordpress-embed-not-working/

    Also, check the youtube settings to make sure the problem is not on that end.

    -Madhu

    Hi Ahmed,

    I am facing the same issue, I did every thing possible to try an fix it. Would you please share how you disabled caching for wp-settings-* ?

    Thanks

    Thread Starter Ahmed Elgameel

    (@elgameel)

    Hi @snipermilan

    After doing my research I found that the problem is with Linode itself.
    YouTube was blocking requests from their Atlanta data center.

    I’ve notified them and they said they will fix it.

    The ONLY way to fix the problem is to migrate to another provider (which I did) or to another data center.

    We have 3 sites on DigitalOcean, 2 are affected by this issue. While the third site is working fine.

    Whats really strange is the fact that the issue comes and goes. Like every few hours all youtube videos will start working, and then an hour later they would stop and so on.

    Thread Starter Ahmed Elgameel

    (@elgameel)

    @snipermilan
    Try calling the video URL from the command line of the server with curl and see what you get, that should show if the server is being blocked or not.

    Hi Ahmed,

    thanks a lot for getting back to me.

    As you suggested, the issue seems to be YouTube temporary bans our IP for “unusual traffic”.

    I tried doing curl https://www.youtube.com/watch?v=oZnhxJwL_PU and sure enough the request didn’t go thro. This is the message returned: Our systems have detected unusual traffic from your computer network. Please try your request again later”.

    I am now positive that youtube is blocking our IP. I have Contacted DigitalOcean and I am waiting for their response.

    Since this issue is happening on two separate domains hosted on two separate virtual hosts “droplets”, I am almost positive its a hosting related issue.

    I will update this once I have more info

    Thread Starter Ahmed Elgameel

    (@elgameel)

    Hi @snipermilan

    You are welcome.

    Unfortunately, you have nothing to do to fix the issue, since it is a server-level issue.

    Also, from my experience, it is unlikely to be fixed soon. YouTube makes it very hard to contact them directly and I think DO will not be able to lift the ban soon.

    I recommend changing the data center or migrating to another provider.
    Also, note that providers reuse IPs, so once your droplet is created, Check to see if its IP address is blacklisted or not.

    Have a good day!

    Hi Ahmed,

    The thing is, we keep getting banned / unbanned. So, one hour videos will be working, and the next they stop, then an hour later the ban gets lifted, and they start working again and so on.

    I just can’t figure out whats making so many connections to youtube network to upset them ??

    Thread Starter Ahmed Elgameel

    (@elgameel)

    @snipermilan

    IDK the reason for sure.

    I think there might be another server(s) on the same IP range heavily requesting YouTube videos which cause YT to block the entire IP range.
    DigitalOcean should be aware of that and fix the problem.

    I hope it gets fixed soon.

    Hi,

    So I managed to pin point the issue. Youtube is blocking a range of DigitalOcean ipv6.

    Disabling ipv6 on our droplet fix the issue. Apparently YouTube is only blocking their ipv6 and not ipv4 for one reason or another. I only disabled ipv6 entirely because I don’t know how to force embedded videos to requests to connect on ipv4 instead of ipv6.

    After notifying DigitalOcean about this, their support are suggesting that we keep redeploying with different IPs till we magically find one that is not banned!

    Mr Ahmed ,
    i have same problem but when i try to put embed code in any php file or any html file with my website files and call this file it’s work fine , but when i try to put this embed code in new post out same error “Sorry, this content could not be embedded.” ,
    my host is hostinger and hostinger team said that problem from wordpress setting ,
    all my website have same problem , do you have solution for it ??

    • This reply was modified 4 years, 11 months ago by elafefy.
    Thread Starter Ahmed Elgameel

    (@elgameel)

    @elafefy

    Since it is mostly a hosting-level issue, I think the only fix is to migrate to a good Hosting provider. This is what worked for me and will certainly work for you too.

    Regards

    thank you for your answer
    this code result from puTTY ssh

    -bash-4.2$ curl https://www.youtube.com/watch?v=fkl23m_51eA
    <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
    <TITLE>302 Moved</TITLE></HEAD><BODY>
    <H1>302 Moved</H1>
    The document has moved
    <A HREF="https://www.google.com/sorry/index?continue=https://www.youtube.com/watch%3Fv%3Dfkl23m_51eA&q=EhAqAkeAAAgAAgAAAAAAAAAZGPjgm_AFIhkA8aeDS1-0ytZq_z8bT7PI7kqMabp_ctbcMgFy">here</A>.
    </BODY></HTML>

    I requested transfer my files to another server , and i will see the result.

    • This reply was modified 4 years, 11 months ago by elafefy.
    Thread Starter Ahmed Elgameel

    (@elgameel)

    @elafefy
    You’re welcome.
    The response of YouTube shows that the IP is blacklisted for unusual traffic.
    I hope migrating your site to another server fixes the issue.

    Have a good day.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Embeds not working on all websites’ is closed to new replies.