Skip to content

How to Hide the Back to Top Button on Mobile

Matt Knighton·Jul 2017·6 min read
How to Hide the Back to Top Button on Mobile

In this simple tweak, we give you a code snippet to remove your back to top button on mobile or tablet devices.

The back to top button is a usability issue for mobile because it covers page content. One alternative is to not use a back to top button, however, you will lose the advantage of having this button on desktops.

The ideal situation is to have a back to top button on the desktop and to hide it on mobile.

This code will work for any page powered by the Divi Theme.

It hides the back to the top button when you are on a device that has a screen size smaller than the media query value.

To learn more check out the video.

You can get the snippet via the below code snippet on gist.

You can also get the code directly on gist.

Don’t forget to get more tweaks and edits on our youtube channel or via the blog.

More Articles & Insights

View all articles ↗
How to Display Multiple Sidebars with Kadence Elements
Mar 2025 · WordPress & AI

How to Display Multiple Sidebars with Kadence Elements

Read Article
Fixing WordPress Emoji Saving Issues with ChatGPT Output
Mar 2025 · WordPress & AI

Fixing WordPress Emoji Saving Issues with ChatGPT Output

Read Article
Why Every WordPress Developer Should Use PHPCS and WordPress Coding Standards
Nov 2024 · WordPress & AI

Why Every WordPress Developer Should Use PHPCS and WordPress Coding Standards

Read Article

Let’s figure it out together

You don’t have to build alone.

A little guidance. A good conversation. A better next step.

Work with me

Start with a 20-minute call. I read every enquiry myself.