Razorfrog Web Design Razorfrog Web Design
  • Home
  • About
  • Services
    • Responsive Web Design
    • E-Commerce Stores
    • Logo & Brand Identity
    • Search Engine Optimization
    • Copywriting & Editing
    • Photography & Imaging
  • Portfolio
  • News
  • Contact
Close
  • Home
  • About
  • Services
    • Responsive Web Design
    • E-Commerce Stores
    • Logo & Brand Identity
    • Search Engine Optimization
    • Copywriting & Editing
    • Photography & Imaging
  • Portfolio
  • News
  • Contact

Passing the Google Mobile Friendly test with WPTouch and WPEngine

April 21, 2015

Preparing for Google’s Mobile Friendly update on April 21st, we noticed that some of our clients’ sites using the WPTouch plugin were unexpectedly failing Google’s mobile-friendly test.  Since all of the sites were hosted with WPEngine, we contacted both WPTouch and WPEngine support. After a bit of back and forth, WPEngine solved the problem by adding the following to the varnish cache for the affected sites.

set $mobile_bot 'no';
if ($http_user_agent ~* (iPhone) ) {
	set $mobile_bot "X";
}
if ($http_user_agent ~* (Googlebot) ) {
	set $mobile_bot "${mobile_bot}Y";
}
if ($mobile_bot = "XY"){
	set $is_bot 0;
}

If you’re having a similar problem passing the mobile friendly test and use WPTouch and WPEngine, try it out!

Posted in: Code Tagged: WooCommerce, WPEngine Author: Max Elman

Share

FacebookTwitter

Leave a Reply / Cancel Reply

  • Prev
  • Next

© 2008-2023 RAZORFROG WEB DESIGN
Sitemap • Terms of Service • Privacy • Cookie Policy • Accessibility
415-480-4587 • 1032 Irving St #984
, San Francisco, CA 94122
Powered by WordPress