Og tag nightmare

Until half an hour ago, I didn’t know what an og (Open Graph) tag was.

I just happen to do a “view source” of one of my product URLs (just as a check as I’m going to be importing over 1000 SKUs for 4 different store views). I happen to see something called

<meta property=“og:title” content=“Test&#x20;Product” />

Hmm… That should be “Test Product”

Has anyone come across something like this? Googling hasn’t yielded much, though this page was useful. https://mage2.pro/t/topic/1013. I’m hoping Craig might have some experience with the issue. It happens regardless of whether the product was imported via CSV (utf-8 encoding) or created directly in the back-end. Is it just another version 2.2.5 bug we have to live with?

I need to go live in 4 days. Can I just ignore it and deal with it later? If possible, I’d rather deal with it now than have to possibly change the name field for over 1000 SKUs (presumably over 4000 records with 4 store views). Want to keep database bloat to a minimum.

I’ve just had a look at a few different installs I have of M2.2.5. However, the output for all my titles appear correctly.

According to the line of code below, it’s pulling the data directly from the Product Name in the database (but with a bit of a spin on it for some reason).

<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>

Are there multiple instances of “Test&#x20;Product” in the source code of that page? Or does it only appear for the og:title? If it’s multiple times then this could mean there’s a deeper issue at stake.

If it’s only for og:title then I’m honestly not sure. The thing is, I’m pretty sure that &#x20; represent a space or something like anyway. Check your Product Page URL on Facebooks Sharing Debugger and see what result it gives under og:title.