Integrate Twitter With WordPress

Twitter/X is one of the most important social media platforms of them all. To say the least, it helps us promote whatever we might have “in store.” I mean, there’s hardly a successful business out there with no presence on Twitter/X whatsoever.

Now, having an official account and posting to it regularly seems to be enough. However, there’s actually a lot more that can be done to multiply the results, and with relatively little effort on our part too.

Here’s our guide on how to integrate Twitter/X with your WordPress site. I go over each of the possible methods and give you a quick tutorial on how to get all of them working:

1. How to embed tweets in WordPress

So what do I mean by embed?

To embed a tweet in WordPress means to take an individual tweet and post it inside one of your pages or posts. The great thing about embedding a tweet is that it acts like an actual tweet on your site – you can interact with it like you normally would on Twitter/X.

Here’s an example (that’s a live tweet):

What did I do to make it work like this? I just copied the tweet’s link and pasted it into WordPress directly. Here’s how:

When you find a great tweet, click on it and take its URL:

Then, go to any of your posts or pages, paste that URL in its raw form, and it will magically turn into a live tweet.

(By the way, you can embed anyone’s tweet wherever you want, not just yours.)

2. How to add Twitter/X cards

A Twitter/X card is basically an expanded tweet view, helping to drive traffic to your website:

twitter-card-example

A Twitter/X card can usually contain, apart from the regular tweet, a featured image, author details, an excerpt, even an image gallery. This depends on what sort of data was associated with the tweet.

Enabling a Twitter/X card for your posts will help you get more attention in the Twitter news feed, as your posts will simply take up more real estate than normal link posts.

You can use Yoast SEO to enable the Twitter/X cards functionality and integrate Twitter/X with WordPress. If you’re already using the plugin – and there’s a big chance you are – you just need to set a few options.

Go to the Site Representation page in the plugin’s settings, and enter in the “Other Profiles” box your Twitter/X username. Make sure to save the changes after you do that:

Image of the Site Representation Page

This is what the Other Profiles box looks like: 

Image of were to enter the URL to the Twitter Account

The next thing you have to do is go to Users » My Profile in the dashboard menu and fill in the Twitter/X username field in the Contact Info section. From now on, each time anyone tweets your posts, they will have cards associated with them.

After saving the changes, the last step is to go to the Site features page and enable the Twitter/X Card Data feature. Save the changes, and that’s it!


Image of the X Card Data feature

3. How to add a Twitter/X feed widget to your site

A Twitter/X feed is a real-time widget box that shows all your tweets in the form of a mini-Twitter/X page. It also allows the users to interact with you right from that box, without having to go to Twitter.

When used right, this sort of stuff can help you increase your visitors’ engagement with your Twitter/X account, and potentially bring you more followers. People won’t look for your Twitter/X account by themselves unless you throw them a chance and a comfortable way to do so.

To use a Twitter/X widget, go to this link, copy-paste your account’s URL then choose Embedded Timeline.

Image of Publish Page Embed Option

Next, the embedded code will appear along with a preview of your widget. Copy the code and paste it anywhere on your site. (Just make sure to be in the Text editor when you do that, it won’t work in Visual.)

Image of Twitter Feed Widget

Here’s my widget:

4. How to add the “follow me” and “share” buttons

If you care about your Twitter/X presence and want your visitors to interact with you, putting a follow button on your site will help. It’s like an invitation for those who are interested in your services/business/persona.

The button is simple, subtle, and yet very useful when it comes to promoting your brand. Best of all, your visitors won’t even need to leave your website to follow you, they can do it right there by clicking the button. In short, this is the proper way to integrate Twitter/X with WordPress.

To add your follow button, you just need to go to the same link we used at point 5 and make a few clicks. Go and click on Twitter/X Buttons, choose your desired button, in this case the Follow Button, and copy-paste your account’s URL.

Image of Publish X Page Follow Button

After pressing Preview you will get the code to your follow button and a preview of it. You only need to paste the code via the Text editor (you can place this button on any given post or page, or even in a sidebar text widget) and you are good to go.

Image of how two copy the code

My button:

How to add a “share” button

Probably the most crucial button you can have on your posts when it comes to integrating Twitter/X with WordPress.

Quite simply, tweet buttons are those little things that allow your visitors to share your content to their Twitter/X profiles.

For instance, you can see something like this in our sidebar:

share-this

To add a Share button, simply follow the same steps used to add a Follow me button. The only difference is that you need to select the Share Button option.

5. How to auto-tweet new blog posts

To start with, how about we integrate Twitter/X with WordPress and set up your site in a way so it tweets your every new post automatically?

For that, you can use the WP to Twitter plugin. Once you have it installed, create a quick Twitter app, complete the required fields, browse through each tab to set the plugin the way you want, and save the changes.

Now, whenever you create a new post, you’ll notice a Twitter/X box in the right sidebar. It allows you to adjust the exact tweet that will go out when you publish the post:

wp to twitter

This makes for a nice way to integrate Twitter/X with WordPress.

Okay, that’s all for now from our side! Feel free to comment and reach out to us in case you’re having any trouble integrating Twitter/X with your WordPress site. 

Yay! 🎉 You made it to the end of the article!

18 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Erez Elias
March 5, 2018 12:49 am

Thank you so much for sharing this.
I wonder if there’s a way to aggregate twitter posts with links to my site and display them on the site.

Chris Fitzgerald
March 5, 2018 6:18 pm
Reply to  Erez Elias

Hey Erez, I am not sure there is a tool like this. Most work on mentions, handles, authors etc etc. I don’t *think you can even build the Twitter widget to track links like this. Could be wrong tho.

It would be a cool tool tho, so if anyone knows one…

Adelina Tuca
March 5, 2018 5:41 pm
Reply to  Erez Elias

Hi! Could you be more specific, please? I need more details to understand what you mean.

Erez Elias
March 5, 2018 7:18 pm
Reply to  Adelina Tuca

Thanks for your reply.
I am looking for a plugin that will add a twitter comment on the site whenever someone mentions your site on twitter.
There is a plugin for this but it hasn’t been updated for 5 years and probably not working well by now.

Adelina Tuca
March 7, 2018 11:23 am
Reply to  Erez Elias

I think you could try this one https://wordpress.org/plugins/wd-twitter-feed/

It adds your Twitter mentions but only in a widget form, just like my Twitter feed in this post (at #5). It adds a feed but only with mentions, not your own tweets (as far as I understood). I’m not sure if it helps. You can try it, though. It’s free.

Erez Elias
March 11, 2018 8:51 pm
Reply to  Adelina Tuca

I’m unable to find what I’m looking for and this probably the closest thing out there.
Thanks for your comment.

boardtc
March 1, 2018 5:03 am

Thanks for the post. Unfortunately #5 user timeline has been changed to profile and there is no option to exclude replies now 🙁

Adelina Tuca
March 5, 2018 5:40 pm
Reply to  boardtc

Hey, that’s right. Thanks for letting me know so I can update the post. Yeah, that’s pretty bad.

Bilal Mustafa
October 17, 2017 9:03 am

Awesome tips. I was looking for how to add inline tweet button for my blog bilalmustafaonline.com. In addition to that, I have learned how to auto schedule my old post. I was making a big mistake of sharing old post frequently. Now, I can do that as well. Thank you for sharing these valuable information.

And for my blog I am using the Zillah theme by Themeisle. So a big thumbs up for that awesome theme. 🙂

Adelina Tuca
December 29, 2017 8:40 pm
Reply to  Bilal Mustafa

Hey, that’s awesome! I’m glad this post was useful to you. Also, my team and I are happy to hear that you’re using Zillah. Good luck! 🙂

Steven Danna
October 13, 2017 11:34 pm

This is such a helpful essay, thanks, Adelina. I have a question you
may help resolve. When I write a wordpress blog, I include a share to
my Twitter profile and write the preview there. Of course. I am used
to seeing my featured image with the tweet. Sometimes, instead of the
featured image being used, it just sucks up the link to the embedded
youtube video instead. This is unacceptable to me. Why is it
happening, and how do I ensure that my featured image is used by
Twitter? Until this is resolved, I cannot directly use the share
function. Thanks so much!

Adelina Tuca
December 29, 2017 8:43 pm
Reply to  Steven Danna

Hi Steven! This happens when you schedule blog posts for social media? Are you using Revive Old Post plugin?

Atul Gaur
August 21, 2017 7:33 am

Great Post Thanks

ParentsAware
August 11, 2017 4:29 pm

Thank you for helping me make sense of this. You explanations are so clear!

Adelina Tuca
December 29, 2017 8:44 pm
Reply to  ParentsAware

Glad I could help. 🙂

Adelina Tuca
March 14, 2017 1:56 pm

Thank you! I’m happy I could help. 🙂

Jean Ndinsil
January 29, 2017 2:26 am

Thank you very much for sharing this great list. I spent my Saturday afternoon improving the look of my blog http://www.parlonsmariage.info with these worthy tutorials. Bring more please!!!!

Adelina Tuca
March 14, 2017 2:00 pm
Reply to  Jean Ndinsil

Thank you, Jean! Happy to hear so. Yes, we will bring more for sure. 🙂

By the way, this is our new blog https://revive.social/blog/, which will be only about social media. So take a look when you can and maybe you can find something useful there too.

Your blog looks great indeed. Good luck with it! 🙂

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!