OG URL, node ID and best practice

AdamGerthel's picture

I've been investigating the og:url tag and canonical URL's tonight in an attempt to wrap my head around the best practice for this.

We've usually always use the node/NID as the canonical URL as well as the URL used for facebook likes. It seemed natural since my idea of a canonical URL is that the URL is persistent. A URL-alias changes if the node title is altered.

However, after getting in SEO/Sharing-trouble with a website that uses node/NID as canonical URL as well as the og:url BUT also uses Global Redirect module (redirecting node/ID to its alias) I'm having second thoughts.

Facebook doesn't like it when the og:url isn't the same as the URL that was liked (see this).

What is the best practice here, considering a use case when you want to use metatags, clean urls, and perhaps also global redirect?


Don't change node URLs

DamienMcKenna's picture

The best solution is to use the URL alias, which is what both Nodewords and Metatag default to using, and then you just have to avoid changing the URL unless absolutely necessary.