With today's mobile responsive WordPress themes, the look of your website on a mobile phone is more important than ever and certain considerations should be put into your website design for mobile phones.

Hide HTML Code on Mobile

How does your website look on mobile? Easy to view? Easy to navigate? Perhaps there are some occasions that you may want to hide a video, images or anything else on a mobile phone to make it more user-friendly.

Sometimes you may want to hide certain things on mobile phones only.

Here is how to hide any website content from a mobile phone only.

From your WordPress theme, you can either add this to your themes CSS editor or add this code directly to your stylesheet, (style.css).  You can also add it directly to your HTML in HEAD the section. (One or the other, not both.)

Once that is saved to your stylesheet or websites HEAD section, the rest is really simple.

Around the text/image/video that you would like to hide from mobile devises, add the code highlighted in yellow in front and behind the section from your HTML or Text Editor. (In other words, don't add this from the visual editor)

<div class="mobileHide">Text/Image/Video That is NOT for Mobile</div>


There ya have it, happy mobile hiding!

PS. Depending on what WordPress theme you are using, all of this extra coding can be avoided by using Divi Theme.

They have a built in editor that you can change what is visible or not visible on PC, Tablet and Mobile.

SEO-Alien

About the Author:

Launched in 2009, SEO-Alien began as a hands-on digital playground—a living archive of marketing predictions, strategic insights, and curated references for tools I relied on daily to drive organic growth. This was a time when content strategy and search optimization were the primary lifelines for digital visibility, long before social media marketing matured into a mainstream channel. Over the years, that foundational "diary" has evolved into an authoritative, tactical resource for advanced WordPress optimization, topical authority mapping, and enterprise-grade search engine marketing strategies.

Pin It on Pinterest

Secret Link