Rank Math, API

Hey guys,

please please please please implement the compatibility with Rank Math. Finally there is an API: https://rankmath.com/kb/content-analysis-api/

Thank youuu :kissing_heart:

Hi RSMG,

I checked the information given in the link that you provided and it is not something that is possible to be implemented by default in our theme. But you can do it yourself or hire a developer to do so as it is considered as customization and outside of our support scope.

To get started please install our Child Theme.

Then create a new file inside wp-content/themes/pro-child/js/ if you use Pro or wp-content/themes/x-child/js/ if you use X and name it rank-math-integration.js.

You need to create the js folder in the Child Theme as the folder does not exist there by default.
Important: We do not know what should be the content of the JS file as the link you provided did not talk about that. You need to contact them to make sure what to add inside rank-math-integration.js file.

The next step is to open up the functions.php file and add the code below at the very end of the file:

wp_enqueue_script( 'rank-math-integration', DIR . '/js/rank-math-integration.js', array( 'rank-math-post-metabox' ), false, true );
RankMathApp.registerPlugin( 'plugin-name' );
wp.hooks.addFilter( 'rank_math_title', 'plugin-name', callback_function_to_fetch_title ) // This will hook into title analysis data.
wp.hooks.addFilter( 'rank_math_content', 'plugin-name', callback_function_to_fetch_content ) // This will hook into content analysis data.

The rest of the functionality is unknown for us per the link you provided. This is what is related to the theme that you can add, the rest depends on the functionality of teh feature which you need to consult a developer or contact Rank Math.

Thank you for your understanding.

1 Like

Thank you very much @christopher.amirian. I will give this a try!

You’re welcome. Glad we’re able to help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.