How to Center a Tweet in WordPress

Twitter is a popular social media where we can share content and interact with users. If you are running a website on WordPress like me, you should know how important social sharing is to the success of a business. Twitter allows you to embed Tweets into your site, so you can share what’s happening on Twitter with your visitors. But how do you align it? In this article, I will show you how to center a Tweet in WordPress.

How to Center a Tweet in WordPress

1. Go to Twitter, select the Tweet that you wish to embed and click Embed Tweet.

screenshot showing the embed tweet menu on twitter

For WordPress, you could easily copy the link to the Tweet and insert into a page to embed it. But that way you won’t be able to center it. So we are going to use the full embed code.

2. Copy the embed code.

screenshot showing how to copy the tweet embed code from twitter

3. Create a new WordPress page or edit one and paste the embed code into the text editor.

screenshot showing how to embed a tweet in wordpress

4. By default, you will notice a class attribute in the embed code: class=”twitter-tweet”. Just edit the class attribute and add this class to it: tw-align-center. So your final class attribute should look like the following:

class="twitter-tweet tw-align-center"

5. That’s it. Now update the page and you should see the Tweet centered on the frontend of your website.

screenshot showing how to center a tweet in wordpress

Disclosure: This page may contain affiliate links. If you follow one of those affiliate links and purchase something it will provide me with a little bit of a commission. This costs you nothing extra but helps maintain my site, free plugins, and themes. So I thank you for your support.

3 thoughts on “How to Center a Tweet in WordPress”

  1. Un buen articulo.

  2. Thank you, any way to embed a tweet in wrapped format?

  3. nice and superb


Leave a Comment