-
Hi,
I found this article
https://rankmath.com/kb/how-to-automate-the-insertion-of-focus-keyword/
is there also a snippet that I could use to automate adding focus keyword to every single product?Thanks for answer.
-
Hello,
Thank you for contacting Rank Math.
You can use the same code for the Products. You only need to set the
post_typetoproductin the code.Hope that helps.
Thank you.
Ok, thanks.
And would it be possible to set automatic alt-text of product pictures according to the product names?Hello,
Yes, you can set your product image’s ALT attributes automatically in Rank Math > General Settings > Images > Add missing ALT Attributes.
Here’s a link for more information:
https://rankmath.com/kb/general-settings/#add-missing-alt-attributesI hope that helps.
Thank you.
ok, thank you.
Hello,
I am happy it helped you. Do you have any other questions or do you want us to mark this as solved?
Thank you.
Hey,
I’m sending you a picture of what I put into functions.php and we were talking about before.
https://imgur.com/Yj0nNXn
I don’t see that the focus word would be set… Should I wait or something is wrong?Also is that okay if I want to use it for every single product?
I’m not so sure if I understood right.
For that case should it be ‘post_type’ => ‘product’
or ‘product’ => ‘product’Hello,
The snippet looks correct based on the screenshot. It is set to run on the first 100 products only as shown in the line with
'posts_per_page' => 100you can add a line below that to give an offset of 100 posts'offset' => 100which you can increment everytime you refresh the website. You may also increase the posts_per_page and offset accordingly.Hope that helps. Please let us know if you have questions.
Ok, thanks.
I noticed it set focus word according to a name of a category, would it be possible to set it so that the focus word would be according to the product name?hello,
You would need to replace the lines that assign
keywords[] = strtolower($term->name);
with something likekeywords[] = strtolower(get_the_title($p->ID));and restructure the rest of the code accordingly.Hope that helps. If you have questions, do let us know.
ok, thanks.
And what is better for SEO, what would you advise me? To set the focus word according to the product category name or set it according to the product name?Hello,
Keywords on their own do not automatically improve SEO. They are meant to guide you in creating content that is as descriptive as possible so that search engines better understand the content.
Which is suitable between post title and categories/tags depends on your content and what your audience might be searching for. However, tags and categories are usually better.
Hope that helps. If you have questions, ask away.
ok, thanks.
Hi I added this code ‘offset’ => 100 to my code. And few times it worked. But now it is no longer adding new keywords. Is it somehow limited or something?
Hello,
Please note that you need to increase the
offsetevery time you load the post/page list until you added the keywords to all of your posts. Since you are adding 100 to your offset, you need to increment it by 100 every time you load the page/post list until all posts have keywords in them.If you already did this and the issue persists, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
What mail should I use for creating the login?
The ticket ‘automate focus keyword to every single product’ is closed to new replies.