How to Change Line Spacing in WordPress ( 5 Easy Methods )

Line spacing is an important aspect of web design that affects the readability and appearance of your WordPress site. It refers to the amount of vertical space between lines of text in a paragraph. By default, WordPress uses a standard line spacing of 1.5em that may not suit your preferences.

If you want to change the line spacing in WordPress, you have several options to do so. In this article, I will show you how to change line spacing in WordPress using different methods, such as through theme customizer, the block editor, the classic editor, with CSS code, and page builders. I will also explain why line spacing matters and how to choose the optimal value for your site

Why Line Spacing Matters in Website Appearance

Your visitors experience and understanding of your content can depend on the space between the lines of your text. If the space is too small, your text will be difficult to read as it will seem crowded and tight.

However, If the space is too big, your text will seem disconnected and sparse, making it lose its meaning and flow. Therefore, you need to find a balance between too little and too much line spacing that suits your site’s style and purpose.

For example, look at the following paragraphs with different line spacing values:

example of line spacing

As you can see, the paragraph with a line spacing of 1.0 looks too tight and uncomfortable to read. The paragraph with a line spacing of 2.0 looks too loose and disjointed. The paragraph with a line spacing of 1.5 looks just right and easy to read.

How to Choose Optimal Value for Your Site Line Spacing

The optimal line spacing for a website depends on several factors, such as font size, font type, paragraph width, and the device used for reading. There is no single answer that works for every website, but there are some general guidelines and best practices that can help you choose the right value for your site.

According to some sources on internet, the ideal line spacing for readability and accessibility is between 130% and 150% of the font size( 1.3 or 1.5em ). However, this range can vary depending on the other factors mentioned above. 

For instance, smaller text sizes may require larger line spacing, while wider paragraph widths and longer paragraphs may also need more space between the lines. On the other hand, larger font sizes (such as headings) can handle less line spacing.

Therefore, it is recommended to experiment with different line spacing values and see what looks best with your text. Now that you know the importance of line spacing, let’s see how you can change it in WordPress using our five methods.

1) Change Line Spacing in WordPress Theme Customizer

One of the easiest ways to change line spacing in WordPress is through the theme customizer. So to access theme customizer, log in to your WordPress dashboard and go to Appearance > Customize.

In Dashboard go to Appearance, there click on customize to open WordPress Customizer

Depending on your theme, you may find the settings for line spacing under different sections, such as Typography or General > then Typography, Content, or Blog. For example, I will show you how to change line spacing in GeneratePress and Astra theme , but the general process is almost same in every theme.

If you encounter any issues with the customizer not working as expected, you can also check out our guide on how to fix WordPress Customizer not working.

So to change line spacing in Astra theme, click on the Global Tab in Customizer > Typography, there you will see different tags for different elements, such as BodyH1H2H3H4H5, and H6.

go to global tab in astra theme
click on typography

Select the tag that you want to change the line spacing for and click on the edit icon. For instance, if you want to change the line spacing for paragraphs, select Body. You will see the default line spacing value of 1.6em, which you can adjust according to your preference.

change line spacing here

For the GeneratePress theme, the layout of the customizer is slightly different, as the Typography tab is visible directly when you open it. Click on it and you will see all the tags for different text elements.

In generate press theme customizer, go to Typography

The Body tag is the one that controls the line spacing for paragraphs, so you can change its line spacing there. The other tags are for headings, such as H1H2H3, and so on. You can select any of them to change their line spacing as well.

Changing line height in typography section of generatepress theme

The above method, I showed to you will change line spacing on your entire website, however to change line spacing on specific parts of your website, explore more of my methods.

For more tips on enhancing your content appearance, check out our guides on changing header background color, changing text color and changing link color in WordPress.

2) Change Line Spacing in WordPress Default Block Editor ( Gutenberg )

If you are using the default WordPress editor, also known as Gutenberg, you can change the line spacing for specific blocks of text, such as paragraphs, headings, lists, quotes, and more. This method is suitable if you want to have different line spacing for different parts of your content in a page or post.

To change the line spacing of a paragraph block, follow these steps:

  • Click on the paragraph block that you want to edit.
  • On the right sidebar, under the Block tab, look for Typography and click on the three dots next to it.
  • In the tools menu, find Line height and adjust it to your preference.
  • Repeat this process for any other paragraph blocks that you want to change the line spacing for on that page.
select paragraph text, in right sidebar, in typography change line height

Some themes may not have the line height option in the typography settings of Gutenberg. If that is the case, you can use an alternative approach in the block editor.

  • Select the block that you want to modify line spacing and click on the three dots icon in the toolbar.
  • click on Edit as HTML from the dropdown menu.
  • Add a custom CSS style for line spacing inside the HTML tag of the block. For example, if you want to change the line spacing of a paragraph block to 1.7em, you can add style="line-height: 1.7em;" inside the <p> tag, like this:<p style=“line-height: 1.7em;”>This is a paragraph with custom line spacing.</p>
click on edit as html
adding line height CSS code in HTML of p tag

Update your page and preview the changes, line height will be changed.

3) Change Line Spacing in WordPress Classic Editor

The classic editor is the old editor for WordPress that was replaced by the block editor in version 5.0. However, some users may still prefer to use it for various reasons, such as familiarity, compatibility, or simplicity. If you are one of them, then you might want to know, how to change line spacing there.

Currently, there is no built-in way in the classic editor to change the line spacing in WordPress. The only way to do it is by using the HTML code, just like we did in Gutenberg editor. To do so, select the text and click on the Text tab at the top right corner of the editor.

You will see the HTML code of your text, where you can add a custom CSS style for line spacing, same code as I provided above:

<p style=“line-height: 1.6em;”>This is a paragraph with custom line spacing.</p>
adding CSS styling code in classic editor

This is how you can change line spacing in Classic WordPress editor.

4) Changing the Line Spacing through CSS Code

Adding CSS code to your site is another method through which you can easily change line spacing. To change the line spacing in WordPress using CSS, you need to follow these steps:

Go to your WordPress dashboard and navigate to Appearance > CustomizeAdditional CSS at the bottom of the left sidebar, add the below code there:

p {
  line-height: 1.6em;
}
h1, h2, h3, h4, h5, h6 
{ line-height: 1.5em; }
Adding CSS code in Additonal CSS tab of customizer

This code will change the line spacing for all paragraphs on your site to 1.6 times the font size.

You can modify the value of line-height according to your preference. You can use pixels (px), em, percentages (%), or unitless values (e.g:1.5). You can also target specific elements or classes by using selectors (e.g., h1.entry-content#post-123 p).

If you want to know how to find the page ID or post ID in WordPress, so you can target specific pages or posts with your CSS code, you can follow this guide on how to find Page ID or Post ID in WordPress

If you want to change specific block line height with CSS, you can follow the second or third method that I explained earlier.

5) Change Line Height in WordPress Page Builders

If you are using a page builder plugin in WordPress, such as Elementor, Beaver Builder, or Divi, you can also easily change the line spacing for your text. To change the line spacing in WordPress page builders, you need to edit the page where you want to modify the text.

In the page builder interface, select the text element that you want to change the line spacing for and look for the typography settings. Depending on the page builder plugin that you are using, the typography settings may be located under different tabs, such as Style, Advanced, or Design.

Once you locate it, then in the typography settings, you will see a line height option, where you can adjust the value according to your preference.

You can change line height in style tab of text widget in elementor like this:

In elementor select the text widget, go to styles, there change line height

If you encounter issues with Elementor, don’t forget to check out our guide on fixing Elementor not loading errors: Elementor troubleshooting.

https://www.youtube.com/watch?v=tw3g4MEex9g

In Beaver Builder you can change line height in style tab > Typography like this:

In beaver builder select the text widget go to styles tab click on font and change line height here

FAQ( How to Change Line Spacing in WordPress )

How do I change line spacing in WordPress?

To change line spacing in WordPress, go to Appearance > Customizer, depending on your theme, locate the section that allows you to modify typography. There in typography, you can adjust the line spacing for different text styles like paragraphs (p), headings (h1, h2, h3), and more.

How can I change line spacing in a block editor like Gutenberg?

In the Gutenberg block editor, you can adjust line spacing by selecting the block you want to modify, then click on the Block settings in the right sidebar. Under Typography, you can customize the line height for that specific block.

How can I set a line height for my content through CSS code?

To set a line height with the help of CSS code, navigate to your Theme Customizer > go to Additional CSS Tab and add the following CSS code:

p {
line-height: 1.5;
}

Here, you can change the value (1.5 in this example) to your desired line height or you can target specific CSS selectors such as H1, H2, H3 and more.

What is the default line spacing in WordPress?

The default line spacing in WordPress generally follows your theme’s styles. It’s usually set to 1.5 or 1.6 times( 1.5em or 1.6em ) the font size, but this can vary depending on the theme you are using.

Are there any recommended line spacing values for better readability?

Line spacing is often recommended to be 1.5 times the font size (e.g., 1.5em) for better readability. However, you can adjust this based on your site’s design and content.

Are there any SEO considerations when changing line spacing in WordPress?

Changing line spacing should not have a direct impact on SEO. However, it’s important to maintain good readability and user experience on your website, as these factors indirectly affect SEO rankings. So, ensure that any changes you make to line spacing don’t compromise your content readability.

Wrapping the Topic

In this article, I have shown you how to change the line spacing in WordPress using different methods, such as the theme customizer, the block editor, the classic editor, CSS code, and page builders. All of these methods are easy to follow and apply.

We all know Line spacing is an important aspect of web design that affects the readability and appearance of your WordPress site. So by changing the line spacing, you can improve the user experience and engagement of your site visitors.

I hope you found this article helpful and informative. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading. 

Hamza Afridi is a Full stack Web & WordPress developer and writer with 5+ years of experience. He is Founder of webtalkhub.com, a blog on web development, SEO, and digital marketing tutorials. He enjoys learning and sharing new technologies.

Leave a Comment