Title: rank-math-ppl.php problem
Last modified: February 11, 2026

---

# rank-math-ppl.php problem

 *  Resolved [tunyk](https://wordpress.org/support/users/tunyk/)
 * (@tunyk)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/)
 * After updating the rank-math-ppl.php code to the latest update on the page [https://rankmath.com/kb/polylang-compatibility/](https://rankmath.com/kb/polylang-compatibility/)(
   February 3), I get the following in the logs:
   PHP Warning: Attempt to read property“
   ID” on null in …/www/wp-content/themes/woodmart-child/rank-math-ppl.php on line
   246

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819335)
 * Hello [@tunyk](https://wordpress.org/support/users/tunyk/),
 * Thank you for contacting Rank Math support.
 * We have updated the guide with the new code that includes the fix for the issue
   you’re facing. [https://rankmath.com/kb/polylang-compatibility/](https://rankmath.com/kb/polylang-compatibility/)
 * Please use the new code on your site.
 * Hope that helps and please do not hesitate to let us know if you need our assistance
   with anything else.
 *  Thread Starter [tunyk](https://wordpress.org/support/users/tunyk/)
 * (@tunyk)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819403)
 * Hello [@jaideeprm](https://wordpress.org/support/users/jaideeprm/) ,
 * I don’t see any changes in the code on the page [https://rankmath.com/kb/polylang-compatibility/](https://rankmath.com/kb/polylang-compatibility/).
   It is identical to what was there on February 3rd.
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819746)
 * Hello [@tunyk](https://wordpress.org/support/users/tunyk/),
 * We have updated the function from:
 *     ```wp-block-code
       public function rm_home_canonical( $canonical ) {
       		global $post;
       		$post_id = (int) get_option( 'page_on_front' );
       		if ( ! is_home() && $post->ID !== pll_get_post( $post_id ) ) {
       			return $canonical;
       		}
   
       		$path = ltrim( (string) wp_parse_url( pll_get_requested_url(), PHP_URL_PATH ), '/' );
       		return $canonical . $path;
   
       	}
       ```
   
 * To:
 *     ```wp-block-code
       public function rm_home_canonical( $canonical ) {
       		global $post;
       		$post_id = (int) get_option( 'page_on_front' );
       		if ( ! is_home() && ! empty( $post->ID ) && $post->ID !== pll_get_post( $post_id ) ) {
       			return $canonical;
       		}
   
       		$path = ltrim( (string) wp_parse_url( pll_get_requested_url(), PHP_URL_PATH ), '/' );
       		return $canonical . $path;
   
       	}
       ```
   
 * Hope that helps and please do not hesitate to let us know if you need our assistance
   with anything else.
 *  Thread Starter [tunyk](https://wordpress.org/support/users/tunyk/)
 * (@tunyk)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819788)
 * This fragment is currently unchanged on your site. I cleared my cache several
   times, but no changes. It is possible that caching is on your side.
 * So I’m using the code from your comment here
 * ![](https://i0.wp.com/scrnli.com/data/3/34/345/3453/34539/34539b/34539bf074fe93510bacc95d1190b2a442ba32a5924a93203ba98775507eaa9d/
   90ef2ab9c52414978.png?ssl=1)
    -  This reply was modified 3 months, 3 weeks ago by [tunyk](https://wordpress.org/support/users/tunyk/).
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819834)
 * Hello [@tunyk](https://wordpress.org/support/users/tunyk/),
 * Sorry for the inconvenience caused. We have cleared the site’s cache and the 
   new code should now be available in the guide.
 * Hope that helps and please do not hesitate to let us know if you need our assistance
   with anything else.
 *  Thread Starter [tunyk](https://wordpress.org/support/users/tunyk/)
 * (@tunyk)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819908)
 * Yes, the code on your site is now updated. Thank you!
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819995)
 * Hello [@tunyk](https://wordpress.org/support/users/tunyk/),
 * We are glad that the issue has been resolved.
 * Please do not hesitate to let us know if you need our assistance with anything
   else.
 * Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frank-math-ppl-php-problem%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * Last activity: [3 months, 3 weeks ago](https://wordpress.org/support/topic/rank-math-ppl-php-problem/#post-18819995)
 * Status: resolved