WordPress.org

Forums

WordPress SEO by Yoast
How do you set the og:locale value? (3 posts)

  1. Lloyd Borrett
    Member
    Posted 2 years ago #

    G'day,

    WordPress version 3.4.2
    WordPress SEO version 1.2.8.7

    WordPress SEO is generating a Facebook open graph og:locale meta tag with 'en_US' as the value.

    I'd like to use 'en_AU' as the value. How can I achieve this?

    I tried changing the WPLANG setting in my wp_config.php file, but that didn't do it.

    Best regards, Lloyd Borrett.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. digitalacorn
    Member
    Posted 2 years ago #

    I used the following in my theme functions.php file to set to en_GB

    add_filter('wpseo_locale', 'override_og_locale');
    function override_og_locale($locale)
    {
    	return "en_GB";
    }
  3. nyodulf
    Member
    Posted 2 years ago #

    Yoast has a check for valid facebook locales when using the function above. Yoast will default to 'en_US' if the 'return' value is not in this list:

    'ca_ES', 'cs_CZ', 'cy_GB', 'da_DK', 'de_DE', 'eu_ES', 'en_PI', 'en_UD', 'ck_US', 'en_US', 'es_LA', 'es_CL', 'es_CO', 'es_ES', 'es_MX',
    'es_VE', 'fb_FI', 'fi_FI', 'fr_FR', 'gl_ES', 'hu_HU', 'it_IT', 'ja_JP', 'ko_KR', 'nb_NO', 'nn_NO', 'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT',
    'ro_RO', 'ru_RU', 'sk_SK', 'sl_SI', 'sv_SE', 'th_TH', 'tr_TR', 'ku_TR', 'zh_CN', 'zh_HK', 'zh_TW', 'fb_LT', 'af_ZA', 'sq_AL', 'hy_AM',
    'az_AZ', 'be_BY', 'bn_IN', 'bs_BA', 'bg_BG', 'hr_HR', 'nl_BE', 'en_GB', 'eo_EO', 'et_EE', 'fo_FO', 'fr_CA', 'ka_GE', 'el_GR', 'gu_IN',
    'hi_IN', 'is_IS', 'id_ID', 'ga_IE', 'jv_ID', 'kn_IN', 'kk_KZ', 'la_VA', 'lv_LV', 'li_NL', 'lt_LT', 'mk_MK', 'mg_MG', 'ms_MY', 'mt_MT',
    'mr_IN', 'mn_MN', 'ne_NP', 'pa_IN', 'rm_CH', 'sa_IN', 'sr_RS', 'so_SO', 'sw_KE', 'tl_PH', 'ta_IN', 'tt_RU', 'te_IN', 'ml_IN', 'uk_UA',
    'uz_UZ', 'vi_VN', 'xh_ZA', 'zu_ZA', 'km_KH', 'tg_TJ', 'ar_AR', 'he_IL', 'ur_PK', 'fa_IR', 'sy_SY', 'yi_DE', 'gn_PY', 'qu_PE', 'ay_BO',
    'se_NO', 'ps_AF', 'tl_ST'

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress SEO by Yoast
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.