I noticed that not all OpenGraph tags are generated automatically.
For example, I still generate this one via a custom code:
< meta property=“og:url” content=“https://www.prodcamp.com/” />
The problem that I’m facing is that when using a page has localization, this tag stays the same and SEO analytic tools report that OpenGraph tag doesn’t match canonical.
Is there a way to add locale as a variable (like in CMS) to regular pages?
#### Issue details
Pages where the URL specified in `og:url` Open Graph tag and in `rel=canonical` tag is mismatched.
Open Graph tags instruct social networks like Facebook, Pinterest, LinkedIn, and Google+ what information to display whenever a URL to your page is shared.
When Open Graph URL does not match the canonical one, a non-canonical version of a page will be shared on social networks.
#### How to fix
Make sure the URL specified in `og:url` matches the URL of the canonical page unless you have a specific intent.
Please note that URLs inside OG tags must be absolute and utilize the http:// or https:// protocols.
No, the locale path isn’t readily available.
Script. You can use script to just build the
og:url from the canonical, however many platforms won’t run that script on the page indexing.
Reverse proxy. This is the only reliable, comprehensive way, but involves a good deal of technical knowledge to setup correctly.
Embed hack. This likely won’t work here, as Embed elements cannot be placed in the head- however embeds themselves can be localized. On your default locale you could have one
og:url and then in your localized locale, you “localize” that embed and change the content. This is more useful for CSS and locale-specific messaging, less useful for head content, but… you might try it to see if your favorite platforms pick it up.
Thanks for the answer.
I believe that the point of using no-code solutions is to avoid writing code, therefore scripting is the least preferred way (otherwise, why not configure WordPress, right?)
Configuring a proxy will require additional computing resources.
I am looking for an elegant solution that would be manageable by non-technical colleagues when needed.
Sure, up to the edges of the sandbox. You’re trying to climb the wall and add a capability that the developers didn’t provide.
We’ve recently launched Connectify, a no-code platform for creating reverse proxies, currently in its beta stage. We extend weekly invitations to join. This tool allows for straightforward management and customization of your domain paths, giving you complete control over your domain with ease.
If you’d like to take a look we’ve also created a setup guide for Webflow users Webflow setup