I have one page witch has a different language then the rest of the site.

I looked in to many plugins but I can't find a way to chance the content language <html lang="nl-NL" prefix="og: http://ogp.me/ns#"> for just one page.

I use Yoast SEO and he uses <meta property='og:locale' content='nl_NL'/> and that also needs to be en_us

1 Answer 1


Likely you will need to do a bit of custom filtering to get this done.

HTML part likely comes from language_attributes() function and passes through language_attributes filter.

WP SEO part comes from WPSEO_OpenGraph->locale() and passes through wpseo_locale filter.

  • how could i filter one page for example using as an example ID 123. Commented Sep 23, 2013 at 10:52
  • @RoyvanWensen using if ( is_page( 123 ) ) inside your filter function for example
    – Rarst
    Commented Sep 23, 2013 at 11:07
  • i know how to use is_page() But i don't know how to use language_attributes() and WPSEO_OpenGraph->locale() :-) Commented Sep 23, 2013 at 11:12
  • @RoyvanWensen please see linked filtering documentation, you don't need to use those functions, you only need to learn a bit how to use any filter in WordPress, which is very important skill for it :)
    – Rarst
    Commented Sep 23, 2013 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.