Optimize viewport for mobile
PageSpeed warns you to Optimize viewport for mobile when the viewport is not optimized for mobile devices, as this can delay tap interactions by up to 300 milliseconds and negatively impact the user experience on touch devices.
Tap interactions may be delayed by up to 300 ms if the viewport is not optimized for mobile.
Understanding Optimize viewport for mobile
On mobile devices, the browser needs viewport instructions during the initial page render. If the viewport is missing or misconfigured, the browser assumes a desktop layout and rescales it later, which can delay interactions and reduce perceived performance.
Optimizing the viewport improves tap responsiveness on mobile devices, prevents unnecessary scaling and zooming, and enhances overall mobile usability and accessibility.
How to optimize viewport for mobile
This issue is usually caused by a missing or misconfigured tag. Common triggers include an undefined viewport width, a missing or incorrect initial-scale value, outdated or heavily customized themes, or page builders and plugins that override the default viewport configuration.
While WP Rocket cannot fix this issue directly, you can resolve it by ensuring a mobile-optimized viewport meta tag is present in the page <head>, for example <meta name="viewport" content="width=device-width, initial-scale=1">.
You can verify this by viewing the page source in your browser and searching for meta name="viewport", making sure only one viewport tag exists and that it meets the recommended requirements. If the tag is missing, check your theme’s header.php file or the theme settings.
