WPML language switcher in AMP plugin Automattic

Nick van de Veerdonk

4 years ago

Tutorial to implement the WPML language switcher in your AMP content, will render a fixed language selector (flags) at the bottom of your AMP content.

Accelerated Mobile Pages provide an excellent way rank higher with your mobile content. It can be a little tricky to implement as Google insists on a flawless validation but using the AMP plugin by Automattic sure makes things a lot easier. In fact the only difficulties we’ve had were with the WPML language switcher (which generated an illegitimate stylesheet link) and eventually implementing the language switcher function into AMP content.

Step 1: fixing the WPML language switcher validation error

Problem is the link to the stylesheet for the language switcher, unfortunately there has not been a more elegant solution than to remove the reference to the stylesheet entirely and to add the styling manually to your theme.