Hello,
We apologize for the issue you are facing with the integration of your plugin and Rank Math. Thank you for reaching out and for your interest in enhancing the functionality of your plugins with Rank Math.
To trigger the recalculation of the SEO score in Rank Math after bulk edits are made through your plugin, you can use the following approach:
-
Use the rank_math_update_post_meta function: This function is responsible for updating the SEO metadata for a post. You can call this function after your bulk edit process to ensure that the SEO score is recalculated.
-
Hook into the appropriate action: You may want to hook into actions like save_post or wp_insert_post to ensure that whenever a post is updated, the Rank Math functions are triggered to recalculate the SEO score.
-
Manual Recalculation: If you need to manually trigger the recalculation, you can look into using the RankMath ank_math()->score->calculate_score( $post_id ) method, which will recalculate the SEO score based on the current settings and metadata.
Here’s a basic example of how you might implement this:
add_action('your_bulk_edit_action', 'your_bulk_edit_function');
function your_bulk_edit_function($post_ids) {
foreach ($post_ids as $post_id) {
// Your bulk edit logic here
// After editing, trigger Rank Math to recalculate SEO score
if (class_exists('RankMathRankMath')) {
RankMathrank_math()->score->calculate_score($post_id);
}
}
}
This code snippet is a simplified example; you will need to adapt it to fit your specific implementation.
If you have further questions or need more detailed guidance, please feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for your cooperation, and we look forward to seeing how your integration enhances user experience!
Sources:
The #1 WordPress SEO Plugin in 2024 – Rank Math
Dear [Rank Math Team],
Thank you very much for your thorough guidance and assistance.
I have one additional request: once our plugin is fully integrated, would it be possible for you to introduce it on your website? We would be honored to collaborate with you, gain your endorsement, and have our plugin recommended to your users. Please let us know if you need any further information to consider this.
Thank you again for your kindness and support.
Hello,
Thank you for contacting support.
Our team has already replied to your emails about the same with all the information about this integration. The response from the bot is inaccurate and it won’t work so there’s no point in pursuing it.
Last but not least, when the integration is completely done and we can verify that it works completely we can consider the option of including the plugin in our compatibility list on our website.
Don’t hesitate to get in touch if you have any other questions.
Hello,
Thank you very much for considering us for your compatibility list! We’ll make sure the integration is complete and fully functional, then reach out to confirm for your review. I’ll keep you updated as we make progress.
Best Regards
hello
We are integrating our plugin with yours, and we need your help for this. Because we had a problem with the calculation of Seo Score and according to your instructions, we could not solve the problem. Please allow me to give a brief explanation of how our plugin works, maybe you can help us in solving the problem.
As I said before, we have a blog called Bulk Post Edit that allows users to edit the fields of one or more posts at the same time. For this purpose, we created a form similar to https://prnt.sc/oZh9oaMAJetd for them, where they can apply the desired changes to each field, and finally, they press the Do Bulk button, and the changes are applied to the selected backs.
As you can see in the editing form, we have added all the fields related to your plugin that can be changed, the only thing that should be done after the Do Bulk button as a calculation is according to the new values for the fields The value of SEO Rank should be calculated and updated in the relevant field(rank_math_seo_score). Now we don’t know what to do after the DO Bulk button is pressed or what HOOK or function to use to solve this problem. Please explain to us in more detail.
Thank you
Hello,
Unfortunately, we cannot provide any further assistance on this matter as we are not familiar with how your plugins work.
Our plugin has two methods to calculate the scores:
1. Directly from the page via JavaScript but that requires that you include the data of the page in the content by implementing the following compatibility layer: https://rankmath.com/kb/content-analysis-api/
This may or may not work for your use case depending on how you save the data.
2. Use the database tools class to update the scores by calling the file class-update-score.php which is what we do in our database tools.
This option might be the easiest to implement since the code is entirely in PHP but you would need to debug our plugin to see how that class works and extend it in your plugin accordingly.
Thank you and good luck.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.