
Connect your Twitter account to this plugin and the widget will display your latest tweets on your site.
This plugin is compatible with the new Twitter API 1.1 and provides full OAuth authentication via the WordPress admin area.
Built by @timwhitlock / Tim Whitlock
The underlying Twitter API library is available on Github
Also by this author: Loco Translate
You can embed tweets in the body of your posts using a WordPress the shortcode [tweets].
To specify a different user’s timeline add the user attribute.
To override the default number of 5 tweets add the max attribute, e.g:
[tweets max=10 user=timwhitlock]<h3>Theming</h3>
For starters you can alter some of the HTML using built-in WordPress features.
See Widget Filters
and Widgetizing Themes
CSS
This plugin contains no default CSS. That’s deliberate, so you can style it how you want.
Tweets are rendered as a list which has various hooks you can use. Here’s a rough template:
.latest-tweets { /* style tweet list wrapper */ } .latest-tweets h3 { /* style whatever you did with the header */ } .latest-tweets ul { /* style tweet list*/ } .latest-tweets li { /* style tweet item */ } .latest-tweets .tweet-text { /* style main tweet text */ } .latest-tweets .tweet-text a { /* style links, hashtags and mentions */ } .latest-tweets .tweet-text .emoji { /* style embedded emoji image in tweet */ } .latest-tweets .tweet-details { /* style datetime and link under tweet */ } Custom HTML
If you want to override the default markup of the tweets, the following filters are also available:
Here’s an example of using some of the above in your theme’s functions.php file:
add_filter('latest_tweets_render_date', function( $created_at ){ $date = DateTime::createFromFormat('D M d H:i:s O Y', $created_at ); return $date->format('d M h:ia'); }, 10 , 1 ); add_filter('latest_tweets_render_text', function( $text ){ return $text; // <- will use default }, 10 , 1 ); add_filter('latest_tweets_render_tweet', function( $html, $date, $link, array $tweet ){ $pic = $tweet['user']['profile_image_url_https']; return '<p class="my-tweet"><img src="'.$pic.'"/>'.$html.'</p><p class="my-date"><a href="'.$link.'">'.$date.'</a></p>'; }, 10, 4 ); add_filter('latest_tweets_render_after', function(){ return '<footer><a href="https://twitter.com/me">More from me</a></footer>'; }, 10, 0 );<h3>Caching</h3> Responses from the Twitter API are cached for 5 minutes by default. This means your new Tweets will not appear on your site in real time.
This is deliberate not only for performance, but also to avoid Twitter’s strict rate limits of 15 requests every 15 minutes.
You can override the 300 second cache by using the latest_tweets_cache_seconds filter in your theme as follows:
This would extend the cache to 1 minute, which is the lowest value you should consider using on a live site:
add_filter('latest_tweets_cache_seconds', function( $ttl ){ return 60; }, 10, 1 ); This would disable the cache (not recommended other than for debugging):
add_filter('latest_tweets_cache_seconds', function( $ttl ){ return 0; }, 10, 1 );<h3>Emoji</h3> If you want to disable Emoji image replacement, you can filter the replacement callback function to something empty, e.g:
add_filter('latest_tweets_emoji_callback', function( $func ){ return ''; } ); or to strip Emoji characters from all tweets, return your own replacement function that returns something else, e.g:
add_filter(‘latest_tweets_emoji_callback’, function( $func ){
return function( array $match ){
return ‘‘;
};
} );
Screenshot taken with permission from http://stayingalivefoundation.org/blog
Portuguese translations by Leandro Dimitrio
Be aware of Twitter’s display requirements when rendering tweets on your website.
Example code here uses PHP closures which require PHP>=5.3.0 and won’t work on older systems.
Starting from $0 per month.
Rating
Reviewers
33 reviews
Tags
Developed By
Tim W
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Display multiple time zones with a world clock widget that offers clear global times, customizable styles, and a responsive design for better user experience.
Use a subscription button to streamline recurring payments, simplify signup, and help increase conversions with seamless PayPal or Stripe integration.

Show Mastodon posts in a live Mastodon feed that keeps content fresh, strengthens your social presence, and helps visitors engage with your updates.
Track time since important events with a count up clock that displays elapsed days and hours and keeps visitors engaged.
Collect user insights with a feedback form that gathers valuable input, improves user experience, and helps you understand visitor needs more clearly.
Create a mega footer that organizes navigation links, contact info, logos, social icons and improves usability and site structure.
Use product blobs to highlight key items, draw attention to featured products, and guide visitors toward faster and more confident purchase decisions.
Show real time visitor counts with a visitor counter widget that displays live traffic, builds social proof, and boosts engagement.
Add animated headlines to draw attention to key messages and improve user engagement through visual emphasis.
Add a testimonials slider to your site to showcase real customer feedback, build credibility, and increase trust that leads to higher conversions.
Show Tripadvisor reviews to build trust, improve credibility, and help visitors make confident booking decisions that support higher property sales.
Add interactive stories to your site to showcase content in a visual, mobile friendly format that boosts engagement and guides visitors toward action.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
