• While analyzing links on my site (https://wroclaw.oaza.pl/) using an automated tool (https://www.drlinkcheck.com/) I have found out two oEmbed related links in the page header. On same pages (not all of them!), like for example the https://wroclaw.oaza.pl/wydarzenia/kategorie/wydarzenia/, the links are wrong and give a 404 error:

    <link rel="alternate" type="application/json+oembed" href="https://wroclaw.oaza.pl/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fwroclaw.oaza.pl%2Fkategorie%2F">
    <link rel="alternate" type="text/xml+oembed" href="https://wroclaw.oaza.pl/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fwroclaw.oaza.pl%2Fkategorie%2F&format=xml">

    I noticed, that the URL provided as parameter http%3A%2F%2Fwroclaw.oaza.pl%2Fkategorie%2F is different from the “canonical” link as shown in other <link> element:

    <link rel="canonical" href="https://wroclaw.oaza.pl/nadchodzace-wydarzenia/kategorie/">

    If I use http%3A%2F%2Fwroclaw.oaza.pl%2Fnadchodzace-wydarzenia%2Fkategorie%2F as the url parameter it seems to work – it does provide some none 404 result.

    Where is this set up? How to influence those links? Or maybe I should reorder somehow my pages?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The tags come from wp_oembed_add_discovery_links(), but the portion causing your trouble actually comes from get_permalink(). These are all filterable, so it’s hard to predict where the root cause of your trouble is. Narrow down the source by deactivating all plugins and switching to twentytwenty theme. If you check the page source now the oEmbed links should be correct. Restore your theme, then each plugin, one at a time. Check the links after each. When the links are again corrupted, the last activated module is the cause.

    You can try to root out the cause yourself in the module’s source code. Or take up the issue with the responsible developer. The likely filter depends on what object type is involved: post, page, category, etc.

Viewing 1 replies (of 1 total)
  • The topic ‘oEmbed links on my site are wrong’ is closed to new replies.