• Resolved Acal

    (@acal)


    Hello,
    When using Yoast SEO my Twitter preview images do not show on Twitter. It either does not show a <meta name=”twitter:image” …> at all (when viewed form the reverse proxy) or it does not convert the URL to a relative path (usually when viewed from the true URL rather than the reverse proxy).
    Eg.
    <meta name=”twitter:image” content=”https://foo.bar/wp-content/uploads/2022/01/foobar.png&#8221; />
    Need it to always show and look like this:
    <meta name=”twitter:image” content=”/wp-content/uploads/2022/01/foobar.png” />

    Thanks in advance!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Acal

    (@acal)

    It seems that Twitter (I tested with a Twitter card validator) will not accept a default open graph image (og:image) if it has a relative path. When I manually set the Twitter card image in Yoast’s social tab, I can get this to work but only some of the time, and the twitter:image meta is filled in with an image src that is not relative.

    I am beginning to think that a javascript to override the og:image and turn it back to a non-relative path is the way to go.

    Does anyone know if there is a way to force the Make Path Relative plugin to ignore the og:image URLs generated by Yoast, thus leaving them as full URLs and prior to page rendering? TY!

    Same issue here. Relative urls are being used for everything (css/js/images) regardless of the setting selected in the plugin options.

    Downgrading to previous version (1.2.1) fixes the issue.

    It looks like the issue might come from the last line in frontend/class-make-paths-relative.php > make_paths_relative_applied(); This method nicely checks all of the settings and exceptions, but then the last line adds add_filter( 'clean_url', array( $this, 'clean_url' ), 100, 3 ); which calls make_paths_relative_remove() which makes everything relative anyway…

    It’s the only notable change in the code between the current version and the previous version (which still works fine), so I downgraded to v 1.2.1 and that solved things for now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘meta twitter:image not working well with Yoast’ is closed to new replies.