Title: PHP Warning: Undefined variable $rest_api_route
Last modified: December 1, 2023

---

# PHP Warning: Undefined variable $rest_api_route

 *  [Dademaru](https://wordpress.org/support/users/xendo/)
 * (@xendo)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-variable-rest_api_route/)
 * Hello,
 * I’m getting lots of these warnings in error.log:
 *     ```wp-block-code
       PHP Warning: Undefined variable $rest_api_route in ../varnish-http-purge/varnish-http-purge.php on line 976, referer: ../wp-admin/edit.php?product_tag=test&post_type=product&vhp_flush_do=object&_wpnonce=xxx&paged=2
       ```
   
 * It seems that `$rest_api_route` is defined only _If json is NOT disabled_ (line
   885) and when purging **Custom Taxonomies** it doesn’t check `if ( isset( $rest_api_route))`,
   as done for _JSON API Permalink for the post based on type_ on line 903.
 * Kind Regards
 * Dave

The topic ‘PHP Warning: Undefined variable $rest_api_route’ is closed to new replies.

 * ![](https://ps.w.org/varnish-http-purge/assets/icon-256x256.png?rev=3027185)
 * [Proxy Cache Purge](https://wordpress.org/plugins/varnish-http-purge/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/varnish-http-purge/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/varnish-http-purge/)
 * [Active Topics](https://wordpress.org/support/plugin/varnish-http-purge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/varnish-http-purge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/varnish-http-purge/reviews/)

## Tags

 * [Custom Taxonomies](https://wordpress.org/support/topic-tag/custom-taxonomies/)
 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 0 replies
 * 1 participant
 * Last reply from: [Dademaru](https://wordpress.org/support/users/xendo/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-variable-rest_api_route/)
 * Status: not resolved