Import and bulk update titles in database

#66915
  • Resolved Expressinfo
    Rank Math pro

    Hello, great plugin and very nice features. However, I have a trouble. I will be importing a huge amount of articles and they will all have a post title that will not really correspond with a meta title. Those articles will be basically a one time import, so it makes no sense to me to change the template of titles in the RM settings.

    I can edit all those meta titles in the database, which would be fine, but this is where my trouble starts. In the table xx_postmeta, Rank Math creates an entry rank_math_title for posts. My goal is to change all the values in the meta_value column based on my own template only for theose imported articles.

    However, Rank Math seems to only create those rank_math_title entries if I manually edit the meta title in the post edit administration. This would mean that I cannot really edit the whole database, because those entries I want to edit arent there, and RM will use the template version of the meta title, which I dont want to change.

    Is there a way for RM to create all those database entries for every post without me having to manually edit each and every post? Or do you have another solution in mind that would make this work? Thank you in advance, I hope it’s inderstandable.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can use the following filter in your theme function.php to change your titles.

    
    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	return $title;
    });
    
    

    Hope it helps you. Thank you.

    ​​​​​​

    Hello, if I insert for example this:

    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    $title="Test title";
    	return $title;
    });
    

    I simply changes all of the titles in every single post for “Test title”. I don’t really want this. I still want to be able to edit titles in the RM settings in each post and page, but I need to bulk change title for lots of posts just once, and then still use the defined template in RM settings for the rest of the posts.

    This is the situation. I import say a database of actors and every one of them will have their own post. However, After the import, the titles for each of those posts are just the name of the actor, which I don’t like. The title would look:

    Julia Roberts | Website

    I want this changed to sth like:
    %title% – Biography, filmography and info %sep% %sitename%

    I need this ONLY for the imported database, but not for any other post or page. I see the solution in updating the titles directly in the MySQL database, but the entries with titles arent there, unless I manually update the titles in each post. Is there a way for RM to generate those titles in the databese without me having to update every post manually?

    Hello,

    Allow me to consult the dev team on this and get back to you.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    You can edit multiple titles at once:

    Or, check the global settings at WordPress Dashboard > Rank Math > Titles & Meta > Posts.

    Do note the second option only works if you haven’t specifically changed the title tag on individual posts.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Ill try to edit multiple posts at once. Thank you for your help 🙂

    Hello,

    We are glad we could help you.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The ticket ‘Import and bulk update titles in database’ is closed to new replies.