Title: Mfunc Not Working
Last modified: August 20, 2016

---

# Mfunc Not Working

 *  [senator94](https://wordpress.org/support/users/senator94/)
 * (@senator94)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/mfunc-not-working/)
 * After the upgrade my mfunc stop working properly.
 * I am using APC to cache pages and MEMCACHE to cache database and object cache.
 *     ```
       <!-- mfunc 
   
       $ref=getenv('HTTP_REFERER');
       if (strpos($ref,'www.google.com')>0)
       {
           echo 'hello google';
   
       }
       else if (strpos($ref, 'bing.com')>0)
       {
       	echo "hello bing";
       }
       else
       {
           echo "<script src='http://www.mydomain.com/js/fabulous.js' type='text/javascript'></script>
       ";
       };
       -->
       <!-- /mfunc -->
       ```
   
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

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

 *  Thread Starter [senator94](https://wordpress.org/support/users/senator94/)
 * (@senator94)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619912)
 *     ```
       <!-- mfunc {whatgoesinhere}
   
       $ref=getenv('HTTP_REFERER');
       if (strpos($ref,'www.google.com')>0)
       {
           echo 'hello google';
   
       }
       else if (strpos($ref, 'bing.com')>0)
       {
       	echo "hello bing";
       }
       else
       {
           echo "<script src='http://www.mydomain.com/js/fabulous.js' type='text/javascript'></script>
       ";
       };
       -->
       <!-- /mfunc {whatgoesinhere} -->
       ```
   
 *  [MikeHerpDerp](https://wordpress.org/support/users/mikeherpderp/)
 * (@mikeherpderp)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619915)
 * latest update broke mfunc for me as well. any way to rollback to the previous
   version?
 *  [Sean Donovan](https://wordpress.org/support/users/mrsdonovan/)
 * (@mrsdonovan)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619919)
 * It didn’t “break”, they improved it. From the change log:
 * > Improved security for mfunc, now disabled by default and requires security 
   > string in order to execute
 * And in the FAQ:
 * >  How do I implement page fragment caching?
   > First you need to define W3TC_DYNAMIC_SECURITY in your wp-config.php file.
   > define(‘W3TC_DYNAMIC_SECURITY’, ‘somesecurestring’);
   > Edit your templates with the following syntax to ensure that dynamic features
   > remain so. Replace with content of the constant:
   >  Example 1:
   >  <!– mfunc {the W3TC_DYNAMIC_SECURITY string} any PHP code –><!–/
   > mfunc {the W3TC_DYNAMIC_SECURITY string} –> Example 2: <!– mfunc {the W3TC_DYNAMIC_SECURITY
   > string} –>any PHP code<!– /mfunc {the W3TC_DYNAMIC_SECURITY string} –> Example
   > 3: <!–MFUNC {the W3TC_DYNAMIC_SECURITY string} –> echo rand(); <!–/mfunc {the
   > W3TC_DYNAMIC_SECURITY string} –> (etc….) Be aware that WordPress functions 
   > will not be available.
 * Following the instructions above worked for me.
 *  [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * (@mbrinson)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619924)
 * Thanks so much for the tip Sean. Unfortunately it’s not working for me.
    Just
   wanted to report back on my experience. I am running version 0.9.2.9 and I have
   made the changes you described. Still no joy. PHP code is not being parsed. Being
   displayed in plain text in HTML output of the page.
 *  [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * (@mbrinson)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619925)
 * For others who may be looking for a workaround, this is the only thing I know
   to do to get it to work – roll back to version 0.9.2.5. That’s the last version
   I know for certain to be working.
 * You can download it here -> [http://wordpress.org/extend/plugins/w3-total-cache/download/](http://wordpress.org/extend/plugins/w3-total-cache/download/)
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619926)
 * You really, _really_, **Really** do not want to do that. It’s just not safe. 
   See this post for a [good explanation why](http://blog.sucuri.net/2013/04/update-wp-super-cache-and-w3tc-immediately-remote-code-execution-vulnerability-disclosed.html).
 *  [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * (@mbrinson)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619927)
 * Thanks for that Jan, that’s very good info I wasn’t aware of.
 * Any thoughts as to what else I should check if the changes mentioned here are
   not working for me?
 *  [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * (@mbrinson)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619928)
 * Woohoo! I found the answer.
    This support topic -> [http://wordpress.org/support/topic/mfunc-still-not-working?replies=13#post-4130664](http://wordpress.org/support/topic/mfunc-still-not-working?replies=13#post-4130664)
   provided the answer.
 * Go check out my post there for the explanation.

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

The topic ‘Mfunc Not Working’ 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

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

 * 8 replies
 * 5 participants
 * Last reply from: [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/mfunc-not-working/#post-3619928)
 * Status: not resolved