Bulk Import Keyword Help Request

I need some way to make the title work as Keyword in my 800 posts in SmartCrawl. Is there any way to bulk set keywords so I don’t have to go to 800 posts individually to update the keyword?

  • Nithin
    • Support Wizard

    Hi Admin,

    Hope you are doing good today. :slight_smile:

    I'm checking this with our developer to see whether there is any custom workaround or filter that could be used to set bulk keywords in posts.

    Please do note that developers work on complex issues, and have a slow response time. Will keep you posted once I get further feedback regarding this asap.

    Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Nithin
    • Support Wizard

    Hi Admin,

    Hope you are doing good today. :slight_smile:

    We got a quick workaround solution in such a use case. You can implement the following plugin, which allows to bulk update metadata:
    wordpress.org/plugins/custom-field-bulk-editor/

    Once the plugin is activated, under Post > Bulk Edit Fields, you should see the following as shown in the screenshot with the options to choose posts individually or bulk.

    The "Custom Field Name" for Keywords would be:
    _wds_keywords

    For News Keywords, it would be:
    _wds_news_keywords

    You can add the required keywords in the Value field as seen in the screenshot, and saving the changes would ensure the keywords would get updated for bulk posts or pages.

    I gave a quick test, and it seems to work fine. Please do check, and see whether the following workaround would help cover your requirements, or not so that we could give a closer look if needed. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Nithin
    • Support Wizard

    Hi Admin,

    To add page titles automatically as a keyword would require custom coding, I'm checking with our developer to check whether there is any quick workaround that could be implemented regarding this, will keep you posted once I get further feedback regarding this asap.

    Kind Regards,
    Nithin

  • Nithin
    • Support Wizard

    Hi Admin,

    Could you please try the following mu-plugins, and check whether it works fine?

    <?php
    add_filter( 'get_post_metadata', 'wpmudev_sm_use_page_title_as_keyword', 10, 3 );
    
    function wpmudev_sm_use_page_title_as_keyword( $keywords, $post_id, $meta_key ){
        if( '_wds_keywords' !== $meta_key ){
            return $keywords;
        }
        if(
            ! is_admin() && //disable on admin
            is_page( $post_id ) && // only for page
            $title = get_post_field( 'post_title', $post_id )
        ){
            $keywords = esc_attr( $title );
        }
    
        return $keywords;
    }

    The above code would be updating the meta tag for keywords when checked via source code, iefor example:

    <meta name="keywords" content="page title" />

    You can implement the above code via mu-plugins, please do check the following article on how to add via mu-plugins:
    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    Please do check, and let us know how that goes. Have a nice day ahead.

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.