How to Fix the ‘user-scalable=no’ Accessibility Error in Divi (One Simple Code Snippet)

The user-scalable=”no” problem in Divi – and how to fix it fast

You know that moment when you proudly run your freshly built Divi site through Google PageSpeed… and there it is – same accessibility error appears every time:

“user-scalable="no" is used in the <meta name="viewport"> element or the [maximum-scale] attribute is less than 5.”

Ugh. Really, Divi?

The good news? This one’s super easy to fix. Just a tiny code snippet – and your site becomes more standards-compliant (and scores better, too). In this post, I’ll show you:

  • Why this error happens
  • Whether it actually matters
  • And how to fix it – in under 5 minutes
    No plugin bloat, no theme-breaking drama. Let’s go!

First things first: why is this even a problem?

Out of the box, Divi adds this line in your site’s <head>:

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

Which basically tells mobile browsers: “Hey, don’t let users zoom.”

Now, here’s the thing: Most modern mobile browsers ignore that instruction anyway.
Chrome and Safari on iOS and Android typically allow users to zoom even when user-scalable=no is present.

So why does Google PageSpeed complain?

Because technically, this tag violates accessibility best practices. It restricts zooming – something that’s essential for users with visual impairments. So even if it doesn’t block pinch-to-zoom in practice, it’s still flagged as a potential issue in audits.

Bottom line:
This fix won’t suddenly make your site feel different on mobile, but it will clean up your PageSpeed report and align your site with WCAG guidelines.

The fix: allow zooming with one simple code snippet

We’ll replace Divi’s default viewport tag with one that’s more accessibility-friendly:

// Allow scaling to improve accessibility

function remove_et_add_viewport_meta_action() {
    // Make sure the action is removed after Divi hooks in
    remove_action('wp_head', 'et_add_viewport_meta');
}
add_action( 'wp_loaded', 'remove_et_add_viewport_meta_action' );

function custom_et_add_viewport_meta(){
    // Output the custom viewport meta tag
    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=1" />';
}
add_action( 'wp_head', 'custom_et_add_viewport_meta' );

Where to add it? You have two options:

  1. In your child theme’s functions.php
    (If you’re using a child theme – nice!)
  2. Or use a plugin like Code Snippets
    This is the easiest and safest way to add PHP code – no editing files, no stress.

And lately, my favorite snippet manager (shared by one of my awesome Divi Stylist Academy students!) is:
Fluents Snippets – lightweight, reliable, and works beautifully with Divi.

What happens next?

After adding the code:

  • Google PageSpeed will stop flagging this as an accessibility issue
  • Your <head> will output a more WCAG-friendly meta tag
  • You’ll be just a bit closer to having an inclusive, audit-passing website

It’s a small fix – but if you’re working with client sites or optimizing for top scores, it’s worth doing.

Looking for more quick wins for accessibility?

Check out this beginner-friendly guide full of practical tips:
👉 How to Make Divi Sites More Accessible (Simple Tips for Beginners)

Have questions? Need help adding the snippet? Or have a favorite plugin for custom code? Drop a comment – I’d love to hear from you!

Have you seen our

Divi child themes?

Divi Toolbox plugin?

We offer a great selection of high-quality Divi products to speed up your work. Feel free to use a coupon code IREADBLOG at the checkout to get a 10% discount!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Enjoing our content?

You might find this interesting...

License Details

REGULAR LICENSE

Single Site

A regular license allows an item to be used in one project for either personal or commercial use by you or on behalf of a client. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

EXTENDED LICENSE

Unlimited Sites

An extended license allows an item to be used in unlimited projects for either personal or commercial use. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

SUPPORT & UPDATES

Each license is a one-time payment. There are no annual fees. You get lifetime access to product updates. Support is provided for 6 months from the date of purchase.

Server Requirements

SERVER SETTINGS:

  • PHP 7.2 or later
  • upload_max_filesize (256M)
  • max_input_time (300)
  • memory_limit (256M)
  • max_execution_time (300)
  • post_max_size (512M)

PHP.INI SETTINGS:

  • php-xml or/and php-dom
  • XMLReader
  • PHP CURL module

PHP MODULES:

  • allow_url_fopen

Would you like to...

Consult Ania and fellow students?

Join the conversation inside our private FB group.

Would you like to...

Get support privately?

Submit a support ticket via your account page.

Ask Ania?

Submit a question for the next live Q&A session.

Consult fellow students?

Join the conversation inside our private FB group.