Is there a Rank math temporary implementation?

Hi guys. I know the Rank math integration has been discussed frequently and it is awaited by the community but something is not clear in my mind.

I have read that a native Rank math implement is on the road map while no ETA has been issued. This said, based on this thread on the forum I was wondering if that solution works until the native implementation. Rank Math, API

I have contacted Rank math and they refer me to this article:

So here is what I have tried:
1- I have managed to create a /js/rank-math-integration.js file in the child theme and I have added in the file this line of code: *wp_enqueue_script( ‘rank-math-integration’, DIR . ‘/js/rank-math-integration.js’, [ ‘wp-hooks’, ‘rank-math-analyzer’ ], false, true ); *
2- I have added the code proposed here on the forum in the child theme function.php 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.

But it seems to be invalid. The website fails to load reporting the last line of code is wrong.
Is my implementation wrong or something is still missing in Theme X to make this work.

Hi @shimoda,

Thanks for reaching out.
The issue you are having with the code is due to the no closing of the line using the semicolon. The line number 108 and 109 need to close by ; like the following.

wp.hooks.addFilter( 'rank_math_title', 'plugin-name', callback_function_to_fetch_title ); 
wp.hooks.addFilter( 'rank_math_content', 'plugin-name', callback_function_to_fetch_content ); 

Hope it helps.
Thanks

Hi @tristup,
Thanks for the quick feedback!
So, it seems I got caught by blindly copy-pasting the code from post. :slight_smile:

Now, I am facing another issue. Do you know why this new error is happening?

Hi @shimoda,

It seems that the function named registerPlugin is not defined, I would suggest you contact the Plugin Author on this for further help. Please remember that we don’t offer any support to custom coding or related issues.

Thanks

Here is their reply.

Hello,

That compatibility code is not intended to be used in the functions.php as that is not to be added by users but rather it’s intended to be added directly into the plugin that you want to make available to our Content Analysis API, hence why it needs to be done by the plugin/theme developers.

If the developers don’t want to include the compatibility from their side there’s nothing else we can do from our side.

As was mentioned before, plenty of other developers already included that in their page builders and if the developers of Cornerstone want to include that as well they can get in touch with us if they have any technical questions about this implementation.

Don’t hesitate to get in touch if you have any other questions.

Hi @shimoda,

The Pro and the X are already compatible with the said plugin, and you don’t need to add any code. If you are facing any issues while using the plugin only with our theme, please let us know for further investigation.

Thanks

@tristup. This is great news. Here are a few examples of errors reported by Rankmath on the attached images. What explains that Rank math does not seem to recognize the content of the page to evaluate its SEO score?


Hi @shimoda,

Thanks for sharing the feedback. I have already informed our development team of this to check the integration with the said plugin.

Thanks

Thanks @tristup! I appreciate that!

You are most welcome.

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