WebDevStudios / Chat-Room

WordPress Chat Room plugin
26 stars 19 forks source link

Conflict with Yoast SEO plugin OpenGraph Features [with workaround] #31

Closed tunjic closed 10 years ago

tunjic commented 10 years ago

Activating the OpenGraph features (Facebook and Twitter cards) of the Yoast SEO plugin breaks the display of the chatroom comments. There are no js errors, but each contribution to the chat appears blank. The user's name shows up, but not the text of the comment.

With both plugins activated and the OG features on, the source code of a chatroom page has chatroom code inserted in a strange place, in the Head, but when the OG features are turned off, that chatroom code is found further down in the Body. See the attached screenshot of source when OG is on.

What's interesting here is that the chatroom code is replacing the og:description meta tag. So that's the issue... There are some filters working against each other... I'm not sure which, where, etc.

I stumbled upon a workaround.....

The Yoast SEO Plugin allows you to set a unique FB (open graph) description on a per post basis. And surprise, if you set a description for a chat, that description appears and the chatroom code in the moves down to where it's supposed to be, making everything work.

yoast-on