As a web developer, using social media plugins which are famously prone to breaking are the bane of my existence.
That’s why, when I figured out that you could very easily embed a Twitter (X) feed of your timeline directly on your WordPress website without using any plugins, I knew I had to write about it immediately.
This incredibly lightweight solution will only load on the page it’s embedded on, is naturally responsive, and requires virtually no configuration.
Sound too good to be true? It’s not!
The team at Twitter actually did a great job here. They are the ones that built it!
Steps to embed a Twitter feed on your website without a plugin:
- Go to Twitter’s “Publish” page: https://publish.twitter.com/
- Enter the URL of the feed you wish to use (note that you can do your own twitter feed, or even link to a specific tweet) and click the arrow.
- Choose a display option. For a traditional “timeline”, obviously select “Embedded Timeline”.
- Click “Copy Code” to get your embed code, or “set customization options” if you’d like to customize it a bit. I find it’s pretty good right out of the box!
If you’d like to customize the options a bit, the available options are:
– Height (in pixels)
– Width (in pixels – leave this blank and it will automatically adapt to where it is)
– Color scheme (light or dark)
– Language
- Copy the code to your website using the text editor (not visual editor) wherever you’d like it to display, and then publish your changes.
Voila! Your feed is displayed.
This method to embed your Twitter feed or even individual tweets works extremely well, and has tons of advantages over using a plugin:
- It’s extremely easy to set up, unlike plugins
- It’s very lightweight and won’t slow your site down
- It unlikely to break, like the plugins always seem to do
- It adapts to any screen size or to the size of the container it is in
I love it!
It’s worth noting that Facebook has a similar tool, but it doesn’t work nearly as well because, inexplicably, it isn’t responsive and has a bewildering maximum width of 500px. Suitable for a sidebar, perhaps, but that’s it.
So in conclusion: don’t ever use any social media plugins. They are terrible, will break, slow down your site, and are in all ways inferior to this extremely easy method.