A working SEO and Open Graph code example

On every site you’ll build you nowadays will add SEO metadata and Open Graph metadata. That is kind of tedious. So here’s a Labs blog article with code, examples and a step-by-step guide on how you can do that.

It tries to use a best approach in how to select the correct metadata to use on every page, including choice of image for Facebook and LinkedIn.


It’s not written to be the most epic code ever, but more focused on being easy to understand. But still, suggestions about improvements are always welcome. So is bug reports :stuck_out_tongue:

(For EXP-pros there might even be some information or best-practises you didn’t know about.)


Great blog article! Useful tips for everything building apps on Enonic XP.

1 Like

This code example is now obsolete as you are recommended to use our App doing the same thing - and more - instead. SEO Meta Fields just launched: