-
I used the chat bot and following the following information but nothing seemed to work/change.
Me: I have 1,000 posts. I have the keyword in the title like “Keyword: interesting title” how can I insert the keyword but not the interesting title?
Bot: To insert the keyword without including the interesting title in your post, you can follow these steps:
Navigate to your WordPress Dashboard.
Go to “Appearance” and select “Theme File Editor” (for a Classic Theme) or “Tools” and select “Theme File Editor” (for a Block Theme).
In the code editor, locate your theme’s functions.php or rank-math.php file. It is usually located in the /wp-content/themes/theme-name/ directory.
Add the following code snippet to the chosen file:
add_filter( ‘rank_math/frontend/title’, function( $title ) {
// Extract the keyword from the title
$keyword = preg_replace( ‘/Keyword: (.*)/’, ‘$1’, $title );// Return only the keyword
return $keyword;
});
Click on the “Update File” button to save the changes.
This code snippet will extract the keyword from the title and display only the keyword in your post. Make sure to replace theme-name with the actual name of your theme.If you encounter any issues or need further assistance, I recommend reaching out to the Rank Math support team by opening a support ticket here. They will be able to provide you with more specific guidance based on your website setup.”
I followed the instructions given above. Below in the Sensitive data section is the function.php file. Line 12 to 18 is related to Rankmath.
The ticket ‘Bulk Add Focus Keyword.’ is closed to new replies.