How to change the og:url output

As of Yoast SEO 20.0, the settings interface inside our plugins has received a major overhaul. Please update to the latest version of Yoast SEO if your plugin does not look like the screenshots you encounter in our Help center.

Facebook’s OpenGraph metadata allows users to share web pages on Facebook. When you add OpenGraph meta tags to your posts and pages, Facebook will display a preview with images and an excerpt when a link to your site is shared. One of the OpenGraph meta tags is the og:url tag. In this article, we’ll explain how you can change the og:url output.

What does the og:url tag do?

The og:url tag pulls from the permalink of the post/page. When the permalink changes so will that og:url. The most common request to change the og:url is when a site migrates to https and wants to keep their previous share counts.

How to change the og:url output

You or your developer can use the wpseo_opengraph_url filter to customize this feature. Code examples can be found here.

Related articles

Get free SEO tips!