Support » Plugin: Yoast SEO » Removing og:locale doesn’t work

  • Resolved mikey79

    (@mikey79)


    Hi Yoast SEO team,

    I’d like to remove the og:locale tag completely.

    Thus I’ve tried your tutorial for the functions.php modifications: https://developer.yoast.com/features/opengraph/api/changing-og-locale-output/, but it simply doesn’t work.

    Dreamweaver gives me a syntax error concerning the following line of your removal code and then it doesn’t work:

    remove_action( ‘wpseo_opengraph’, [ $wpseo_og, ‘locale’ ], 1 );

    Any ideas?

    Best
    Mikey

    • This topic was modified 11 months, 1 week ago by mikey79.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support devnihil

    (@devnihil)

    @mikey79 Can you confirm what version of PHP you are using on your site?

    Thread Starter mikey79

    (@mikey79)

    Sure. Give me 5 min, please. 😉

    Thread Starter mikey79

    (@mikey79)

    @devnihil PHP version is 7.4.8.

    Thread Starter mikey79

    (@mikey79)

    Could this discussion about ‘og:locale’ give a hint? ‘Well the $wpseo_og global no longer exists in Yoast 14+ so it will always be null (…)’ –> see: https://github.com/VaLeXaR/wp-multilang/issues/152#issuecomment-623411744

    Plugin Support Rumejan Barbarona

    (@onlyincebu)

    Hello @mikey79!

    Sorry to say this goes beyond the scope of support of the Yoast forums. The filter desribed here has been tested to work with WordPress but may not work the same way if you have custom integrations such as the integration you have with Dreamweaver. We hope you understand.

    Thread Starter mikey79

    (@mikey79)

    @onlyincebu – I think, this is a misunderstanding. Just to clarify: I’m using WordPress with Yoast. There is no ‘custom integration with Dreamweaver’. I only use Dreamweaver to edit PHP-files. I could also edit the file with a text-editor or any other editor – that doesn’t change anything.

    Fact is: The Yoast filter doesn’t work with Yoast 14.5, WordPress 5.4.2 and PHP 7.4.8. So this should be an issue for every Yoast user using WordPress, PHP and Yoast – at least with the above mentioned current versions.

    So I guess it definitely is a topic for the support forums here.

    Plugin Support devnihil

    (@devnihil)

    @mikey79 Thanks for the clarification, and we’re sorry for any confusion.

    Regarding your issue, we tested the code from the developer documentation you are using here and confirmed that it is not removing the og:locale tag as expected. We also tested it using version 13.5 of the plugin and found it did work when using that version. So this issue does look to be due to the changes made as of the 14.0 release of the plugin, related to the deprecation of wpseo_opengraph the addition of the wpseo_og_locale filter.

    To resolve this, would you please be able to create an issue report for the incorrect documentation? You can create a new GitHub issue report for our developers here: https://github.com/Yoast/wordpress-seo/issues/new

    Thread Starter mikey79

    (@mikey79)

    @devnihil Thank you very much! I’ve directly set up an account and mentioned the issue here: https://github.com/Yoast/wordpress-seo/issues/15684

    Plugin Support devnihil

    (@devnihil)

    @mikey79 Thanks for reporting the problem in an issue report with our developers.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Removing og:locale doesn’t work’ is closed to new replies.