How to Add a Smooth Scroll in WordPress (Step-By-Step)

How to Add a Smooth Scroll in WordPress (Step-By-Step)

Do you want to add a sleek, smooth scrolling effect to your website?

By the end of this guide, you will learn how to implement smooth scrolling like a pro, giving your website a polished touch.

Here are the contents of this guide:

  • The essence of the smooth scroll effect
  • Step-by-step plugin integration
  • Manual coding techniques
  • Premium themes with the effect

Ready to elevate your web design game? Let’s jump right in!

What is the smooth scroll effect?

Have you ever visited a website where the scrolling felt exceptionally smooth, almost like gliding through the content seamlessly?

That’s the smooth scroll effect in action. It’s a feature that can significantly enhance the way you interact with a website.

The smooth scroll effect is a web design technique that animates the scrolling process:

So instead of jumping abruptly from one section to another, the page scrolls in a fluid, continuous motion.

This is often compared to the difference between taking the stairs (standard scrolling) and riding an escalator (smooth scrolling).

In addition, when you click on a link or navigation menu designed with smooth scroll, the page will not snap to the target location.

Here’s an example:

It will travel smoothly, improving readability as you follow the motion to the new section.

This effect is not just about aesthetics — it’s about enhancing user experience by providing a more controlled and gentle navigation through the content.

What are its benefits and disadvantages?

Smooth scrolling comes with its set of benefits and disadvantages that can impact user experience and website performance.

Here’s a concise look at the pros and cons:

👍 Benefits

  • Enhances user experience: It provides a modern, polished feel to your website, making navigation feel intuitive and smooth.
  • Facilitates storytelling: As users scroll through your site, the smooth motion can be used to create a narrative or guide them through your content.
  • Reduces abruptness in navigation: It eliminates the jarring transitions between page sections, providing a seamless flow.
  • Highlights elements during the scroll: You can draw attention to specific content or images as the user scrolls down the page.
  • Improves navigation with anchor links: Smooth scrolling can make using anchor links to jump to specific sections much more pleasant.

👎 Disadvantages

  • Motion sickness for some users: The continuous motion effect can cause discomfort or motion sickness in sensitive individuals.
  • Browser inconsistencies: Not all web browsers handle smooth scrolling in the same way, which can lead to inconsistent experiences.
  • Increased load times: Implementing smooth scroll, especially with heavy JavaScript, can increase page load times.
  • Potential for distraction: If overused, it can become a gimmick that distracts rather than aids in navigation.
  • Browser conflict: The smooth scroll can sometimes conflict with the native scroll behavior of browsers, leading to unexpected results.

While the smooth scroll effect enhances your site’s user experience, the underlying web hosting plays a crucial role in performance.

SiteGround offers dependable hosting that pairs seamlessly with your site’s design, ensuring reliability and speed.

ultrafast managed wordpress hosting by siteground

Here’s what you stand to gain with SiteGround:

  • Benefit from 99.9% uptime guarantee
  • Only for $3.99/month — that’s already for an entire year of seamless hosting
  • Experience a hosting platform tailored for global reach and performance

With SiteGround, you’re not just choosing a web host; you’re enhancing your website’s ability to deliver a consistently smooth and engaging user experience.

How to Add a Smooth Scroll Effect

Now that we’re on the same page about what the smooth scroll effect is, it’s time to get into how to actually implement this sleek functionality on your website.

To add smooth scroll, you typically have two routes to choose from:

  1. Using a WordPress plugin
  2. Diving into some code

There’s actually a third option — using premium themes that come with the smooth scroll effect out-of-the-box. I’ll get into this later.

1. Use the MouseWheel Smooth Scroll plugin

MouseWheel Smooth Scroll is a free plugin that introduces a smooth scrolling effect when navigating with a mouse wheel, touchpad, or keyboard arrows.

mousewheel smooth scroll by kubiq

💻 Key features

  • Smooth scroll customization: Adjust the scrolling animation to suit the feel of your site with customizable settings.
  • Flexible navigation: Enhances navigation using the mouse wheel, touchpad, or keyboard arrows.
  • Control over motion parameters: Fine-tune parameters like FrameRate, animationTime, stepSize, and pulseScale for optimal performance.
  • Compatibility: Works well with various browsers, though it has limitations with Safari when using a mouse.

Using it is simple:

Step 1: Install the plugin

Search for the plugin’s name from the repository then install and activate it on your website.

install now and activate mousewheel smooth scroll

Step 2: Go to the plugin’s settings

After the plugin has been activated, you can now change the settings since it won’t automatically apply the smooth scroll effect.

Go to settings > smooth scroll:

smooth scroll admin settings in the wordpress dashboard

Step 3: Configure the plugin

The settings here are divided into five main groups:

  1. Scrolling core
  2. Pulse ratio
  3. Acceleration
  4. Keyboard settings
  5. Other

All you have to do here is change the settings and hit the save button below the page.

change the general settings of the plugin

The settings I messed with are only the ones in the scrolling core group since they’re the ones you primarily need to change.

Unfortunately, if you need more information on what the other settings do,  you must try them for yourself since there’s no documentation.

Once you’re done, you can check out your website and see if you like the new smooth-scrolling animation settings.

2. Other plugins you can use

Do you need more options?

Well, the truth is, there aren’t a lot of plugins made just for smooth scrolling. There are some out there that include this in their features.

However, here are some WordPress smooth scroll plugins you can use:

Surbma – Smooth Scroll Plugin

Surbma is a minimalist and straightforward plugin that applies a smooth scroll effect to every anchor link across your site.

It is designed to work out of the box without any need for configuration:

surbma | smooth scroll by surbma

💻 Key features

  • Automatically applies smooth scroll to anchor links, including in menus or navigation sections
  • No configuration required; it just works upon activation
  • Utilizes Ariel Flesler’s jQuery.scrollTo & jQuery.localScroll scripts
  • Maintains functionality even if you switch themes

Anchor Smooth Scroll

Anchor Smooth Scroll focuses on enhancing the behavior of anchor links in WordPress, providing a smooth scrolling effect upon clicking anchor links.

It’s a simple solution for smoother navigation within a page or across pages:

anchor smooth scroll by inprocess

Warning: As of the time of writing, the plugin hasn’t been tested with the last few WordPress versions. No negative feedback though, but try at your own discretion.

💻 Key features

  • Lightweight, with a focus on speed and efficiency, without scroll events
  • Supports scrolling from and to different pages
  • Allows offset scrolling by a specified number of pixels or based on an element’s CSS selector
  • Customizable scrolling animation duration
  • Capability to add custom anchor links and to override default theme anchor behavior
  • Includes an anchor button feature for the TinyMCE editor

jQuery Smooth Scroll

Like the previous plugins, jQuery Smooth Scroll enhances the scroll movement of the mouse wheel on your WordPress site.

This provides a smoother scrolling experience, especially beneficial for sites with longer pages like blogs or e-commerce sites.

jquery smooth scroll by digital liberation

Warning: As of the time of writing, the plugin hasn’t been tested with the last few WordPress versions. No negative feedback though, but try at your own discretion.

💻 Key features

  • Compatible with Google Chrome and WebKit-based browsers
  • Works with popular WordPress plugins and page builders
  • Full keyboard support for navigation
  • Compatible with all themes and major WordPress frameworks
  • Utilizes native JavaScript for better performance and cross-platform compatibility
  • Customizable settings for step size, animation time, and more
  • Easy installation process from the WordPress admin area
  • Additional features include full touchpad support and the ability to exclude pages with a shortcode

3. Manual code integration

You don’t want to use plugins?

Well, you can also integrate a smooth scroll effect manually into your WordPress site with a few steps. Unfortunately, you may need a developer to check your work.

🔕 Disclaimer: I’m not a developer, although I’m familiar with the general steps on how to implement the smooth scroll effect. Contact a developer to check and confirm your work.

Here are the general steps:

Step 1: Create the JavaScript file

For this, you need to use Notepad to create the JavaScript file and name it something like smooth-scroll.js or something similar.

You will then have to enter the script.

Here’s a basic example of how to implement smooth scrolling for anchor links on a website:

document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();

        document.querySelector(this.getAttribute('href')).scrollIntoView({
            behavior: 'smooth'
        });
    });
});

🔕 Disclaimer: The script above is a sample script only that could enable your site to scroll smoothly. Consult a developer if it doesn’t work.

Step 2: Add the JS file to your website

From there, you need to add the file to the /js/ directory on your WordPress website (if there’s none, you can create one).

You will need either your web hosting’s file manager app or a transfer protocol program like Filezilla to upload the file to your site server.

using filezilla for file transfer

Step 3: Enqueue the JavaScript

You will then need to enqueing the script within your theme’s functions.php file to ensure it loads on your site.

For this, you would add a function that uses wp_enqueue_script() to include your JavaScript file like this:

function theme_name_enqueue_smooth_scroll_script() {
    wp_enqueue_script('theme-name-smooth-scroll', get_template_directory_uri() . '/js/smooth-scroll.js', array('jquery'), null, true);
}
add_action('wp_enqueue_scripts', 'theme_name_enqueue_smooth_scroll_script');

This function hooks into wp_enqueue_scripts, which is the proper way to add scripts and styles to your WordPress site.

The true parameter at the end of wp_enqueue_script specifies that the script should be added to the footer

This is often recommended for performance reasons and to ensure that the DOM is fully loaded before the script runs.

After that, test the smooth scroll across different browsers and devices to confirm it works seamlessly and keep an eye on your site’s performance.

🔕 Disclaimer: If nothing worked, check with a developer. The steps above are general and might not work on your website.

Premium Themes With Smooth Scroll Effect

Do you prefer to use a theme that already has the smooth scroll effect built in?

Fortunately, many premium WordPress themes come with this feature built-in, offering not only a stylish look but also a functional and seamless browsing experience.

👉 Related: Best Premium WordPress Themes: No Free Themes Here

Here are some of them:

1. Astra Theme

Astra is acclaimed for its lightweight and rapid performance, making it an exceptional choice for those aiming to enhance SEO and user experience.

the most popular theme of all time

It’s a versatile theme that’s highly customizable and fits various types of websites, from portfolios to WooCommerce stores and personal blogs.

👉 Related: Astra Theme Review: Popular Choice or Just Overhyped?

💻 Key features

  • Customization: Offers extensive design options and global color and typography controls for full customization of your site​​.
  • SEO-focused: Includes SEO-friendly features like integrated Schema.org code for better search ranking potential​​.
  • Smooth scroll: Provides improved site accessibility with a smooth scroll feature​​.
  • Starter templates: Comes with over 280+ importable starter templates, one of the largest collections available​​.
  • Compatibility: Supports native WordPress block editor (Gutenberg), Elementor, and Beaver Builder, providing flexibility for your preferred editing experience.

💰 Pricing

  • Has a free plan
  • The pro plan starts at $59/year

The great thing here is that both the free plan and the pro version support smooth scrolling — great if you’re on a budget.

2. Blocksy Theme

Blocksy is a Gutenberg-friendly WordPress theme, designed to be easily customizable using the Block Editor.

create unlimited number of advanced headers and display them on individual pages

It’s a versatile theme suitable for any website type, from agencies to shops, offering a combination of innovative design and lightning-fast performance.

👉 Related: Blocksy Theme Review

💻 Key features

  • Performance: High-speed performance with impressive scores on Google PageSpeed and GTmetrix​​.
  • Page-building: Full compatibility with Gutenberg, along with support for Elementor, Beaver Builder, and Brizy​​.
  • WooCommerce integration: Seamless e-commerce features in the free version and additional premium options​​.
  • Social functionality: Supports a wide array of social networks for integration into your website.

💰 Pricing

  • No free plan here
  • Pro versions start at $49/year

The plan I mentioned above is the personal plan, which is only good for one site but with lifetime support and updates.

3. Betheme

Betheme is one of the most popular multi-purpose themes on ThemeForest, renowned for offering over 700 ready-made websites.

end possibilities with theme options for betheme

Developed by the Muffin Group, it’s suitable for a wide array of industries and continually updated with new features.

👉 Related: Betheme Review: Pre-built Heaven or 1-License Hell?

💻 Key features

  • Versatility: Suited for over 30+ industries, capable of building diverse types of websites from online stores to magazines​​.
  • BeBuilder: An in-house editor that allows for detailed customization, almost comparable to the Elementor page builder.
  • Options system: Extensive settings and options for in-depth customization of your site​​.

💰 Pricing

  • Sold per item at $60

You can only buy Betheme from ThemeForest. The product includes future updates and 6 months of support from its creators.

4. Ohio Theme

Ohio is a creative WordPress theme designed for building modern and functional websites like blogs, online shops, or portfolios.

home page of the ohio theme

It is integrated with top tools like WPBakery and Slider Revolution and is WooCommerce-powered for e-commerce functionalities.

💻 Key features

  • Plugin support: Accommodates a variety of plugins including WPBakery, ACF Pro, Slider Revolution, Contact Form 7, and more​​.
  • Mobile-friendly: Fully adapted to mobile devices, offering a flawless browsing experience on tablets and phones​​.
  • Performance: Delivers fast loading speeds and high website performance due to its well-structured code​​.
  • SEO tools: Comes equipped with SEO tools and features to help rank higher in Google searches​​.
  • Design and customization: Offers a sleek, modern-looking portfolio design with a ton of customizable options and smooth CSS3 animations.

💰 Pricing

  • Sold per item at $59

Similar to the previous theme, this can only be bought at ThemeForest. It also comes with future updates and 6 months of support.

Adding the Smooth Scroll Effect

Whether you’re drawn to the seamless interaction of smooth scrolling for aesthetic or functional reasons, integrating this feature can significantly boost your website’s user experience.

Options abound, from plugins that make installation a breeze to manual code tweaks that offer custom solutions.

If you prefer a more straightforward approach, premium WordPress themes like Astra, Blocksy, BeTheme, and Ohio deliver this functionality out of the box, along with other powerful features.

Whichever path you choose, enhancing your site with smooth scrolling is a step towards a more polished and engaging web presence.

After mastering smooth scrolling, the next step is simplifying your site’s upkeep, especially with themes.

Darrel Wilson’s offer sweeps away the hassle of updates and support costs, revolutionizing your Elementor experience.

get full access to all premium template kits

Get lifetime access to all premium template kits crafted specifically for Elementor:

  • Get lifetime access to all premium template kits designed for Elementor
  • Complete with 2 years of dedicated support
  • Only for $99 — that’s already for the lifetime access

Embrace the ease of this offer and keep your site effortlessly stylish and up-to-date.

Alan Anthony Catantan
Alan Anthony Catantan

Welcome to Darrel Wilson's corner of the web! While he's the genius behind this blog and YouTube channels, I'm the fun sidekick ensuring everything's in tip-top shape. From writing articles to video magic, we deliver content with a splash of fun! 🚀📝🎬

Related Posts
Leave a Reply

Your email address will not be published.

Prove your humanity: 1   +   6   =  

[]