Horizontal scroll can be very annoying. It makes your website look bad. It also makes it hard to read. Let’s learn how to fix it.

Credit: www.wpbeginner.com
Credit: www.linkedin.com
Why Horizontal Scroll Happens
Horizontal scroll happens when content overflows. This means content goes beyond the screen size. This can be due to large images, long text, or wide elements. We need to fix this for a better user experience.
Step-by-step Guide To Disable Overflow
Follow these simple steps. You will learn how to disable overflow and remove horizontal scroll.
Step 1: Log in to Your WordPress Dashboard
First, you need to log in to your WordPress dashboard. Use your username and password. Once logged in, you will see the admin panel.
Step 2: Go to Appearance and Then Customize
In the admin panel, find “Appearance” on the left menu. Click on it. Then click on “Customize.” This will open the theme customizer.
Step 3: Add Custom CSS
In the customizer, look for an option called “Additional CSS.” Click on it. You will see a box where you can add custom CSS code.
Step 4: Enter the CSS Code to Disable Overflow
Now, you need to add the CSS code. This code will disable overflow. Copy and paste the following code into the box:
body {
overflow-x: hidden;
}
This code hides the overflow on the x-axis. It will stop horizontal scroll.
Step 5: Publish Your Changes
After adding the code, you need to publish your changes. Look for the “Publish” button at the top. Click on it. This will save and apply the changes to your website.
Other Methods To Remove Horizontal Scroll
There are other ways to remove horizontal scroll. Let’s look at some of them.
Method 1: Use a Plugin
You can use a plugin to help you. There are many plugins available. One popular plugin is “Simple Custom CSS.” Follow these steps:
- Go to the WordPress dashboard.
- Click on “Plugins” and then “Add New.”
- Search for “Simple Custom CSS.”
- Install and activate the plugin.
- Go to “Appearance” and then “Custom CSS.”
- Add the same CSS code:
body { overflow-x: hidden; }
- Save your changes.
Method 2: Fixing Specific Elements
Sometimes, specific elements cause overflow. You need to fix these elements. Here are some common elements:
- Images: Make sure images are not too wide. Use CSS to set a max-width.
- Text: Long text without spaces can cause overflow. Break it into smaller parts.
- Tables: Use CSS to make tables responsive.
Example CSS Code
Here is some example CSS code to fix these elements:
img {
max-width: 100%;
height: auto;
}
table {
width: 100%;
table-layout: fixed;
}
.long-text {
word-break: break-word;
}
Testing Your Changes
After making these changes, you need to test your website. Open your website on different devices. Make sure the horizontal scroll is gone. If you still see the scroll, check for other elements causing overflow.
Use Browser Developer Tools
Browser developer tools can help you. Right-click on your website and select “Inspect” or “Inspect Element.” This will open the developer tools. Look for any elements causing overflow. Fix these elements using CSS.
Conclusion
Disabling overflow in WordPress is easy. Follow the steps in this guide. Use custom CSS or plugins. Fix specific elements causing overflow. Always test your changes. Make sure your website looks good on all devices. Removing horizontal scroll improves user experience. It makes your website look clean and professional.
We hope this guide helps you. Now you know how to disable overflow in WordPress. Remove that annoying horizontal scroll today!
Frequently Asked Questions
How Do I Disable Overflow In WordPress?
You can disable overflow by adding CSS code to your theme’s stylesheet.
Why Is There Horizontal Scroll In WordPress?
Horizontal scroll usually appears due to wide elements or improper CSS settings.
What Css Code Removes Horizontal Scroll?
Use `overflow-x: hidden;` to remove horizontal scroll in your CSS file.
Where Do I Add Custom Css In WordPress?
Add custom CSS in the theme’s stylesheet or use the Customizer under Appearance.