[Resolved] Adding Meta Keywords

Home Forums Support [Resolved] Adding Meta Keywords

Home Forums Support Adding Meta Keywords

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #651672
    Brett

    My client wants to add Meta Keywords to each individual pages. It appears like Yoast removed that from their plugin. Is this something that ACF would be good to use? If so, would I add some sort of code to functions.php?

    Thank you!

    #652009
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You could, then you’d just need to output the custom field in the wp_head hook like this.

    You could also try a plugin like the SEO Framework.

    Yoast should technically still have the option – maybe it’s just turned off by default?

    #652057
    Brett

    I understand your comment about using the hook, but was there supposed to have been a piece of code there to echo out the ACF string for each page?

    #652308
    Tom
    Lead Developer
    Lead Developer

    Yes, you’d likely need to use their get_field() function: https://www.advancedcustomfields.com/resources/get_field/

    So something like:

    <?php
    $keywords = get_field( 'your_key' );
    if ( $keywords ) {
        echo '<meta name="keywords" value="' . $keywords . '" />';
    }
    ?>
    #658207
    Brett

    That worked. Thank you!!!

    #658435
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #2050821
    srimali senn

    Hi can you please let me know where do i insert key words in the following code, i want to add meta keywords in generatepress hook

    <?php
    $keywords = get_field( ‘your_key’ );
    if ( $keywords ) {
    echo ‘<meta name=”keywords” value=”‘ . $keywords . ‘” />’;
    }
    ?>

    Eg: my key words are red, blue, yellow, green

    #2050887
    David
    Staff
    Customer Support

    Hi there,

    the original topic owner is using the ACF Plugin. Are you using ACF?

    #2051942
    srimali senn

    I am not using ACF, I want to insert meta keywords to my wordpress website

    #2052141
    David
    Staff
    Customer Support

    Are you using an SEO plugin? As those generally provide Keyword and Description Meta fields.

    #2052144
    srimali senn

    I use Yoast unpaid version, it has meta key phrase, is it meta key words?

    #2052149
    David
    Staff
    Customer Support

    This article from Yoast explains Keywords ( And why no one should use them ):

    https://yoast.com/meta-keywords/

    And this article includes a reference to Meta Descriptions and keyphrase:

    https://yoast.com/meta-descriptions/#keyphrase-in-meta-description

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.