Title: Don&#039;t cache some code
Last modified: August 21, 2016

---

# Don't cache some code

 *  [Javier](https://wordpress.org/support/users/ivaxtobachotmailcom/)
 * (@ivaxtobachotmailcom)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/dont-cache-some-code/)
 * I don’t want to cache a part of code that it uses ip to know country. I tried
   it
 *     ```
       <!--mfunc -->
       <?php
       	$country = pais_visitante();
       	if ($country=="ES") { $pais="España"; } elseif
                    ($country=="MX") { $pais="Mexico"; } elseif
                        ($country=="AR") { $pais="Argentina"; } elseif
                            ($country=="CO") { $pais="Colombia"; }
                              else $pais="Común";
       ?>
       <!-- /mfunc -->
       ```
   
 * but it don’t works. What can i do?
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Javier](https://wordpress.org/support/users/ivaxtobachotmailcom/)
 * (@ivaxtobachotmailcom)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/dont-cache-some-code/#post-3736760)
 * I try it too
 *     ```
       <!--MFUNC mycode -->
       <?php
       	$country = pais_visitante();  // function to get Country Code
       	if ($country=="ES") { $pais="España"; } elseif
                     ($country=="MX") { $pais="Mexico"; } elseif
                        ($country=="AR") { $pais="Argentina"; } elseif
                            ($country=="CO") { $pais="Colombia"; }
       			else { $pais="Común"; $offset=4; }
       ?>
       <!-- /mfunc mycode -->
       ```
   
 * But still caching this part. I trying remove <?php but in this case it’s echo
   on web.
 * I’m desperated. Please give me a solution please

Viewing 1 replies (of 1 total)

The topic ‘Don't cache some code’ is closed to new replies.

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

## Tags

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

 * 1 reply
 * 1 participant
 * Last reply from: [Javier](https://wordpress.org/support/users/ivaxtobachotmailcom/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/dont-cache-some-code/#post-3736760)
 * Status: not resolved