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.