WooshBuild: Adding Lines - A Step-by-Step Guide

Adding a new line in WooCommerce is a common task when you want to insert a line break in your product description or content. While WooCommerce doesn't natively support line breaks in the text editor, there's a simple fix using a shortcode or an HTML entity. This guide will show you how to add a line in WooCommerce.

a white background with green, red and yellow lines on the left side of it
a white background with green, red and yellow lines on the left side of it

The WooCommerce platform uses the WordPress TinyMCE editor, which doesn't preserves line breaks by default. To include a line break, you'll need to use one of the methods described below:

a screen shot of a web page with an image of the user's profile
a screen shot of a web page with an image of the user's profile

Using HTML Entities

HTML entities represent special characters, and there's an entity for a line break: ' '. Here's how to use it:

two screens showing different types of text
two screens showing different types of text

1. Inside the product description or content editor, type or paste:
or
<br>

Manually Adding Line Breaks

W1D1
W1D1

If you prefer not to use HTML entities, you can manually add line breaks by using shortcodes. WooCommerce supports several shortcodes that can help you format your content. Here's how to use the 'hr' shortcode to insert a line:

1. Type or paste this shortcode in your product description or content editor: [hr}

The 'hr' shortcode will add a horizontal rule, creating a line. You can adjust the line's color or style using CSS if needed.

an app showing the progress of installing and configuring ui designs for mobile devices
an app showing the progress of installing and configuring ui designs for mobile devices

Using Visual Editor for Adding Lines

For those who prefer a visual interface, you can add a line using the Visual Editor Mode. Here's how:

1. In your product description or content editor, click on the 'Text' tab to switch to the Text Mode. 2. Press 'Enter' or 'Return' once to create a line break. 3. Switch back to the 'Visual' tab.

the built for you app is displayed on an iphone screen, with icons above it
the built for you app is displayed on an iphone screen, with icons above it

Adding Soft Hyphens

In some cases, you might want to add a line break only if there's enough space on the line. For this, use the 'shy' HTML entity: <span> Text</span>

some type of text that is being displayed on a computer screen, with different font and numbers
some type of text that is being displayed on a computer screen, with different font and numbers
an image of a web page with the settings for different types of content and features
an image of a web page with the settings for different types of content and features
an iphone screen showing the settings and features for different platforms, including work & collaboration
an iphone screen showing the settings and features for different platforms, including work & collaboration
a screenshot of the sandbox interface with text and images on each screen, including an email address
a screenshot of the sandbox interface with text and images on each screen, including an email address
an image of a computer screen with various items on it, including buttons and numbers
an image of a computer screen with various items on it, including buttons and numbers
derkachcreate
derkachcreate
a cell phone with codeflow on the screen and blurred cityscape in the background
a cell phone with codeflow on the screen and blurred cityscape in the background

The soft hyphen ('­') will create a line break only when necessary, preventing long words from overflowing onto the next line. This is particularly useful for long product names or titles.

Now that you know how to add a line in WooCommerce, you can enhance your product descriptions and content, making them more engaging and easy to read. Give these methods a try and see which one works best for your needs.