I have a wordpress page that is dynamic. WordPress SEO By Yoast adds opengraph tags to all pages which isn’t a problem except on this one page.
Is there a way to overwrite the meta tags with more dynamic content?
I have a wordpress page that is dynamic. WordPress SEO By Yoast adds opengraph tags to all pages which isn’t a problem except on this one page.
Is there a way to overwrite the meta tags with more dynamic content?
You must be logged in to post a comment.
Looking through the code of Yoast SEO, I found many “undocumented” filters you can use. Here is a list extracted from it:
EDIT:
A few things to remember:
Facebook scraps the url in the
og:url
tag (even if it’s not the actual url you give it).If you return
false
from the wp filter function, Yoast will not display that tag, so you can use it like that, and then manually add the tag somewhere else in your code where you need…For example, here is some code to disable description and image tags for og and twitter:
Yoast make various filters available. See their WordPress SEO API Docs article for a list of them. So, for example, if you wanted to change the opengraph type of a blog post with ID
86
, you could use thewpseo_opengraph_type
filter: