Title: do not cache custom php code
Last modified: April 15, 2020

---

# do not cache custom php code

 *  Resolved [joshuazire](https://wordpress.org/support/users/joshuazire/)
 * (@joshuazire)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/do-not-cache-custom-php-code/)
 * hello. there is way to declare: do not cache custom php code. i had to put random
   text output in footer template. can i have an example ? something like this i
   want:
 * `if do not cache() { echo 'rand text'; } else {}`
 * thank you
    -  This topic was modified 6 years, 1 month ago by [joshuazire](https://wordpress.org/support/users/joshuazire/).
    -  This topic was modified 6 years, 1 month ago by [joshuazire](https://wordpress.org/support/users/joshuazire/).

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

 *  [enkirch](https://wordpress.org/support/users/enkirch/)
 * (@enkirch)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/do-not-cache-custom-php-code/#post-12737713)
 * Hey, do you already have solution here?
 *  Thread Starter [joshuazire](https://wordpress.org/support/users/joshuazire/)
 * (@joshuazire)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/do-not-cache-custom-php-code/#post-12744613)
 * no. only solution is to add code in “wp-super-cache/plugins/dynamic-cache-test.
   php”. delete example 1 from there. in code example 2: put your code between `
   ob_start();` and $text = ob_get_contents(); . and follow the instructions from
   wp-admin to enable dynamic cache.

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

The topic ‘do not cache custom php code’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [super cache](https://wordpress.org/support/topic-tag/super-cache/)

 * 2 replies
 * 2 participants
 * Last reply from: [joshuazire](https://wordpress.org/support/users/joshuazire/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/do-not-cache-custom-php-code/#post-12744613)
 * Status: resolved