Clicky

  1. Home
  2. Developer Docs
  3. Extending
  4. How to detect if it’s AMP page with Function?

How to detect if it’s AMP page with Function?

If you are developing some code and you want to detect if it’s AMP then you can use the below code.

Warning: is_amp_endpoint() is depreciated from AMPforWP

If you are facing any warnings in the debug log or on the website like

Notice: is_amp_endpoint was called <strong>incorrectly</strong>. is_amp_endpoint() is deprecated from AMPforWP, please use ampforwp_is_amp_endpoint instead. Please see <a href=”https://codex.wordpress.org/Debugging_in_WordPress”>Debugging in WordPress</a> for more information.

Then to solve this warning, go to the path mentioned in the warning and  find is_amp_endpoint and replace it with ampforwp_is_amp_endpoint

This will fix the warnings.

Hope it helps. If you have any questions, then please ask us in the below comments.

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on April 26, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment