This is an error on the side of twitter. I have all the meta tags at place only when Twitter makes a request.
I use a simple filter on the user agent to see if a request comes from Twitter or Facebook and only then the meta tags are added.
Does Twitter even use it’s own “Card Validator” to validate request for a twitter card, or is this done in a different matter? I think it’s not needed to have the Open Graph and Twitter tags in my headers when people are on my website as only Twitter,Facebook and Google use them. So when each of these websites makes a request the meta tags get added to keep my header clean and save bandwidth when ever possible
So now comes the big question, if Twitter wants the Meta tags visible 24/7 in my header how can I ever validate? My websites are 100% valid and both the
"Card Validator" from twitter and the url linter of Facebook give me a 100% positive result.
Hope someone can shed some light on this for me.
in my header to filter out a twitter request (before all other markup)
function is_twitter(){
if(!(stristr($_SERVER[“HTTP_USER_AGENT”],‘Twitterbot’) === FALSE)) {
return true;
}
}
then in my functions.php (Wordpress) - not showing the full custom open graph/twitter code but this should show globally how i’m filtering request.
if( is_facebook() || is_twitter() ) {
post all tags here etc
}