hello@ayzmancreative.com

Journal

Website development in Cleveland: when speed plugins break menus

A lot of website development in Cleveland gets checked on a desktop and signed off there. On a home builder’s site we worked on, desktop looked perfect, and on a phone the logo and menu bar were simply missing. The thing that broke it was a speed setting that was supposed to help.

How remove unused CSS causes it

Most WordPress speed plugins offer a feature called something like remove unused CSS. It scans the HTML your server sends, keeps the styles that match what it finds, and throws the rest away. That sounds sensible, and for a lot of sites it makes a real difference.

The catch is that the plugin only reads the HTML the server sends. Plenty of themes build parts of the site with JavaScript after the first load, and the mobile menu bar is one of the most common. The plugin never sees it, decides its styles aren’t being used, and strips them. On the home builder’s site, that’s exactly why the header vanished on phones.

The fix was to add the menu’s selectors to the plugin’s exclusion list. When that’s too fiddly, you can exclude the theme’s header stylesheet entirely. Either way the site keeps most of the speed benefit.

The delay JavaScript setting does something similar

Another popular option holds scripts back until the visitor taps or scrolls. That’s a good idea for chat widgets, analytics and review badges, which nobody needs in the first second. It’s a bad idea for the script that builds your mobile menu, because someone tapping the menu button expects it to open on the first tap. If the script is delayed, the first tap just wakes it up, and the visitor taps again or leaves.

Anything the first screen depends on should be excluded from delay settings. That usually means the menu, any slider at the top, and your cookie notice if you have one.

How to test your own site

Open your site on your phone in a private browser tab, and don’t touch the screen for a few seconds. Is the header there? Then tap the menu button once. It should open right away. Try it on an iPhone and an Android if you can, and on a tablet, since themes often switch to the mobile header at tablet widths too.

If something is missing or slow to respond, temporarily turn off the speed plugin’s CSS and JavaScript options one at a time and reload. When the problem goes away, you’ve found the setting that needs an exclusion.

Good website development in Cleveland includes this kind of test on real phones before a site launches, and again after any speed plugin is changed. It’s part of every custom website development project we do, and we check it when we take over WordPress websites from other developers.

If your mobile menu has ever acted strangely, send me the site and tell me which phone you noticed it on. I’ll test it on a few devices and tell you which setting is the likely cause.

Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy