Twitter Cards
-
After reading this article I applied the direction. https://kb.yoast.com/kb/setting-up-twitter-cards-in-wordpress-seo/#activate
I still cannot see an image on twitter when I share my website.
The page I need help with: [log in to see the link]
-
Upon reviewing the link provided, the Twitter image tag does not contain the absolute URL of the image; instead it contains a relative URL like so:
<meta name="twitter:image" content="/wp-content/uploads/2019/06/filename.jpg" />A relative URL is not a valid URL for sharing content on social media and may cause issues with search engines. As this does not happen for all URLs on the page, I suspect that you have a plugin that rewrites image URLs to be relative (without a protocol and domain). Please adjust the settings so the image URLs contain the absolute URL of the image (with a protocol and domain).
The fastest way to To determine which plugin or theme causes this behavior is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Nineteen.
Test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin allows you to run a conflict check without affecting normal visitors to your site.
As we can imagine that you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts.
I have created a sub domain and the only plugin I downloaded is yoast and tried to test this on twitter and it is still not working. This is the test site domain with theme twenty nineteen. http://test.dcypherstudios.com/index.php/test/
Using Twitter’s card validator, an image is found and should be used when sharing the link for the test site
https://pasteboard.co/IkChCTi.png
Upon reviewing the source code of the test site, we see that the image URLs are full URLs.
<meta property="og:image" content="http://test.example.com/wp-content/uploads/2019/06/filename.jpg" />This further confirms that something in your original setup changes the image URLs to a relative path by removing the
http://example.compart of the URL.I deactivated Cache for WordPress Performance and URLs appeared properly, how ever images still do not procure on twitter.
We rechecked the URL of http://dcypherstudios.com/pretoria and reviewed the source code and the image source path is still using relative paths to the images for both Twitter and Open Graph (see image here):
<meta property="og:image" content="/wp-content/uploads/2019/06/a2736691460_16-1.jpg" /> <meta property="og:image:secure_url" content="/wp-content/uploads/2019/06/a2736691460_16-1.jpg" /> <meta name="twitter:image" content="/wp-content/uploads/2019/06/a2736691460_16-1.jpg" />In order for the images to be able to be read by Twitter the paths would need to be in absolute format.
As you can see the URL is shown properly now http://prntscr.com/o89ukb
Twitter images still do not appear
Twitter caches previously shared URLs. We used the Twitter card validator to confirm that Twitter sees the images now.
How come it does not show up on Twitter? I cant see it.
Hi,
We checked in Twitter regarding https://dcypherstudios.com and we can confirm the right image and title and meta description are all appearing as excepted. See image:https://imgur.com/a/qFjARg0
Can you confirm that the issue is resolved?
yes it works now thank you
The topic ‘Twitter Cards’ is closed to new replies.