Your web project was going well until you had to align and justify some text in WordPress, to span the width of the text field, or to display some paragraphs as if they were a document, and your day stopped there. You searched for a long time and you have not found the magic button that manages to justify the text of the paragraph, and WordPress removed the justify button since version 4.7. It happened to us too and as always, we will show you the trick so you can justify your paragraph.
What is justified text in WordPress
You probably already know it. When you align text as justified in WordPress, the content of the paragraph will be aligned by distributing the white spaces between the left and right margins, so that it occupies the entire width of the text field. The computer does this by adding free space between words as necessary, and it is the way to visually define what the boundaries are.
In case you haven’t noticed, this last paragraph of text is justified on purpose, and fills each line from side to side.
When to use justified text in WordPress
Justify text is especially useful when we have several columns of text within the same page or WordPress post to generate a neat and blocky effect, and help the eye separate one column from the other. In a document with a single column, this is practically not necessary.
Another use of justified text in WordPress is on internal pages where terms and conditions, a legal notice or any text that has a document or contract format are displayed. It is advisable to align the text to the left, which is the most natural for the human eye.
The golden rule regarding UX
If you are thinking about justifying text solely for aesthetic reasons, consider not doing so if the paragraph or line of text is less than 50 characters. In this case, large spaces occur that break into the reading. There are other factors that also influence when making decisions about whether to justify or not, such as font size. If we are selecting a size that is too small, awkward spaces may occur that could bother the reader.
How to justify text in WordPress
As we already told you at the beginning, WordPress removed the option from its page editor since version 4.7, and from that moment on it is necessary to use the code or install a plugin to solve it. Of course, the easiest and cleanest way to do this is by inserting HTML code, but there is also the possibility of adding a plugin to recover the function.
How to justify text in WordPress with HTML code
The steps to justify a paragraph or text on a page or post using HTML code are very simple:
First open the page or entry, select the text block and within the options menu, go to Tools and then to Source code.
Now replace the string that is before the paragraph text begins and that begins with “
When you save the changes by pressing the OK button, you will see that the text was aligned as justified.
How to justify text in WordPress using a plugin
Now let’s go to justify the alignment of a paragraph or text using a WordPress plugin. Have you seen how there is a plugin for everything? Fortunately, this plugin does not consume resources from your hosting plan since it will only be responsible for, among other things, adding the “Justify text” button to the editor options, as was the case before WordPress removed it from its options.
The plugin we will use today is called Advanced Editor Tools and its previous name was TinyMCE Advanced. At the time of creating this note, it has more than 2 million active installations and hundreds of good reviews, so you should not worry. Advanced Editor Tools is available within the official WordPress repository.
The first thing you should do is search for it, install it and activate it within your WordPress administrator:
Not so fast, it’s not install and go! Now go to the plugin settings.
Scroll to the title Toolbars for the classic paragraph and classic blocks, check the Activate the editor menu check box if it was not already there, and drag the Justify option below to the menu model above.
TIP! If you would like to add any of the other available options, you can drag them to the menu as well.
When you’re done, go to the bottom and save your changes.
Now, go to the block editor and…. Tada! You can now justify your paragraphs in one click.
If you find that the menu to change the format is not displayed, do this: click on the non-printable symbol, and then select the Classic Paragraph option. With this it should appear as you see in the previous image.