OG:Description problem with links to Facebook.
-
I like the Simmer plugin, but noticed a problem a while back, which discouraged me from using it. However, I have just delved into the plugin code and have fixed it, for my own benefit. Thought I would share here.
The problem is that I tend to Crosspost content from my blog to a Facebook Group, and what Facebook displayed as the Link Preview was not what I needed.
Instead of an item named
‘Easy Sweet and Sour Sauce’
it was displaying
‘<span itemprop=”name”Easy Sweet and Sour Sauce</span>’
The plugin was surrounding the title with html code, and this was picked up by Facebook and used to build the link to the article.
It looks horrible and I didn’t like it.
I found the offending lines were at the function add_title_schema at line 237 of class-simmer-frontend.php.
I commented out the lines that actually wrap the title, and gave it another try. I half expected something to fall over, but I can’t see any problem in WordPress, and it now looks great in Facebook.
I know what I should do is leave the function, and look for where it is called elsewhere, but for now, disabling the wrap suffices for me. If someone else has a more elegant solution, I will be interested.
If anyone wants to look at this problem, simply look at the Facebook debugger page, and enter a link to a Simmer Recipe. You will see the effect under Link Preview, but also under “og:description
- The topic ‘OG:Description problem with links to Facebook.’ is closed to new replies.