Support » Plugin: Yoast SEO » Making the description meta tag generated by Yoast multilingual

  • Resolved theJuls

    (@thejuls)


    I was directed to post here from the general questions. So my apologies if this is not the most appropriate place for this.

    To make things clear, I would like to do this without the use of another plugin. I am aware that there is WPML, but from my understanding it is paid.

    The main problem here is the description meta tag which is bilingual and I would like to have it change according to the site’s current language.

    As it stands, I am told that I can insert the description meta tag through the functions.php using add_action. This unfortunately does not work as it only adds another description meta tag.

    Currently my code looks like this:

    function insert_meta_tag_in_head () {
        echo '<meta name="description" content="My Translated content" />';
    }
    add_action('wp_head', 'insert_meta_tag_in_head', 1);

    So basically this just gives me a second description meta tag. I have also seen in other threads, that if I want to replace a tag, I should use the do_action function. Which I call as follows:

    do_action('wp_head', 'insert_meta_tag_in_head');

    This however does nothing. What am I doing wrong? How can I change the contents of the description tag given to me through Yoast?
    Perhaps there is an easier way to change it through the plugin?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making the description meta tag generated by Yoast multilingual’ is closed to new replies.