How to Center Text in WordPress

Photo of author

By Oluwaseun Bamisile

Published

Don’t know how to center text in WordPress? Read this guide as it teaches various methods to achieve that.

How To Center Text In A Specific Post/Page

There are two major ways you can align text to the middle of a WordPress post or page. You can either make use of the text alignment tool in the WordPress block editor or use HTML.

Well, the following sub-sections will demonstrate how to center-align text in a WordPress post/page using those methods.

Option 1: Center Text in a Specific Post/Page Using Text Alignment Tool

  1. Sign in to your WordPress site’s backend dashboard using an administrator account. Then, click Posts or Pages among the options on the dashboard’s left pane, depending on where you want to center a text.
  1. Afterward, open the page/post where you wish to center the text by left-clicking its title. For this example, I will open an untitled post on our WordPress site.
How To Center Text In A Specific WordPress Post/Page
  1. When the post/page opens, click the block with the text you wish to align to the center. Now, click the Align icon in the toolbar above the block, then select Align text center from the displayed options.

Option 2: Center Text in a Specific Post/Page Using HTML

  1. Log on to your WordPress site’s backend dashboard using an administrator account. Next, depending on where you want to center a text, click Posts or Pages among the options on the dashboard’s left pane.
How To Center Text In A Specific WordPress Post/Page
  1. Following that, left-click the title of the page/post where you want to center-align the text to open it. For this demonstration, I will open an untitled post on our WordPress site.
  1. When the page/post opens, click the Options icon (three vertical dots) at the top right corner. Then, select Code editor from the displayed options.
How To Center Text In A Specific WordPress Post/Page
  1. Now, input the following HTML code in the opening paragraph or header HTML tag that wraps around the text you want to align to the middle.
class="has-text-align-center"
  1. After doing that, click Exit code editor. Hence, the text will be aligned to the center – see the second screenshot.
How To Center Text In A Specific WordPress Post/Page

How To Center Text Across Site

Interestingly, with a simple CSS code, you can align the text across your WordPress site to the middle. The step-by-step procedures below demonstrate how to achieve that.

  1. Log in to your WordPress site’s backend as an admin. Then, hover your mouse cursor on Appearance on the backend’s left pane and select Customize from the displayed options.
  1. On the Customize page, select Additional CSS on the left pane.
How To Center Text Across A WordPress Site
  1. Now, input the following CSS code in the Additional CSS input field.
.entry-content {
    text-align: center;
}
  1. Finally, click the blue Publish button at the top of the page to save the change.
How To Center Text Across A WordPress Site

Frequently Asked Questions

1. How do I change the alignment of text in WordPress?

To change the alignment of text in a WordPress post or page, follow the steps below.
a) Sign in to your WordPress site’s backend dashboard using an administrator account.
b) Then, click Posts or Pages among the options on the dashboard’s left pane, depending on where you want to change the alignment of a text.
c) Afterward, open the page/post where you wish to change the alignment of the text by left-clicking its title.
d) When the post/page opens, click the block with the text you wish to change its alignment.
e) Now, click the Align icon in the toolbar above the block, then select your preferred alignment from the displayed options.

2. What is an alignment?

Alignment or align is a term used to describe how text is positioned in a paragraph.

3. Can I align text in WordPress?

Yes, you can align text in WordPress.

4. What are the types of alignment?

There are left alignment, right alignment, center alignment, and justified alignment.

5. Is WordPress free?

Yes, WordPress is completely free.

Conclusion

Aligning text to the middle in WordPress is a fundamental design skill that can help enhance the visual appeal and readability of your content. Moreover, center-aligned text can easily draw attention to important information on your website.

Also, it can make your site’s content appear more organized and professional. Fortunately, this guide provided multiple ways to center-align text in a specific WordPress post or page.

To be specific, we discussed how to perform the task using the text alignment tool in the WordPress block editor. We also learned how to execute the task using HTML.

Besides that, I also included steps to align text across your WordPress site to the middle using a simple CSS code in this guide.

Hopefully, you found this WordPress guide helpful. If you did, click on “Yes” beside the “Was this page helpful” question below.

You may also express your thoughts and opinions by using the “Leave a Reply” form at the bottom of this page.

Lastly, visit our WordPress & Websites How-to Guides page for more insightful guides like this.

We go the extra mile to deliver the highest quality content for our readers. Read our Content Writing, Content Review, and Anti-Plagiarism policies to learn more.

About the Author

Photo of author

Oluwaseun Bamisile

Oluwaseun is the Lead Content Editor at Itechguides.com. He holds a National Diploma in Computer Science (currently studying part-time for his Higher National Diploma). An internet geek with a love for automobiles, he writes product reviews, tech articles, and how-to guides on the site.

Related Articles

Get in Touch

If this article does not meet your expectations, kindly let us know. We have various ways you can get in touch with us:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment