Rotating Tweets (Twitter widget and shortcode)


  • Replaces a shortcode such as [rotatingtweets screen_name='your_twitter'], or a widget, with a rotating display of your most recent tweets
  • Supports v 1.1 of the Twitter API (i.e. it works)
  • Supports the new longer tweet format
  • Space efficient – instead of showing all your tweets at once, shows one at a time and then smoothly replaces it with the next one. After showing all your tweets, loops back to the beginning again.
  • Reliable – keeps showing your latest Tweets even if the Twitter website is down.
  • Customizable – you decide whose tweets to show, how many to show, whether to include retweets and replies, and whether to show a follow button. You can also decide how quickly the tweets rotate and what type of animation to use.
  • Responsive – resizes as your page resizes
  • Gives you the option to show a fully customizable Twitter ‘follow’ button
  • Replaces links with the original link
  • Caches the most recent data from Twitter to avoid problems with rate limiting
  • Uses jQuery, jQuery.Cycle and jQuery.Cycle2 to produce a nice smooth result.
  • Compatible with W3 Total Cache.
  • Supports Do Not Track (DNT)
  • Multi-lingual – now set up to be multi-lingual. The Twitter ‘follow’ button is automatically translated to match your site’s language setting if Twitter has made the appropriate language available. Also uses WordPress’s multi-lingual capability to enable translation of all the other text used by the plug-in via language packs.

If you’d like to see what the plug-in looks like in action, you can see the plug-in working here.


Most of this is my own work, but special thanks are owed to:

Thank you to the people who did the original translation work for the following packs:

  • Wilmerson Felipe for his work on Brazilian Portuguese
  • Nils Kroneberg for his work on German
  • Alberto Lario for his work on Spanish
  • Mattia Migliorini at deshack for his work on Italian
  • Natasja Weijer for her work on Dutch
  • Alexandre Trudel for his help on French
  • Borisa Djuraskovic at Web Hosting Hub for his help on Serbian


  • This animation shows rotating tweets inserted into a blog-post via a short code. It is slightly faster than the default setting, but gives a sense of what you get.
  • You can add rotating tweets via a Widget:
  • Or by using a shortcode:


What options can I use for the shortcode?

All the options are listed on the Rotating Tweets installation page.

How can I include Rotating Tweets in my template?

Try something like:

A common mistake with do_shortcode shortcodes is to use single-quotes or double-quotes all the way through without ‘escaping’ them. This will normally break your site! It’s best to use double-quotes to enclose the shortcode string and single-quotes inside the shortcode string (or vice-versa!).

How can I pull information from two accounts into one widget

The easiest way is to list more than one account in the ‘Twitter name’ box in the widget or use something like screen_name='account1 account2' in the shortcode.

How often does the plug-in call Twitter

In most cases, each use (or “instance”) of this plug-in gets data from Twitter every 2 minutes. The exception is when two or more instances share the same settings (screen name etc.), in which case they share the same data rather than each calling it separately.

My Rotating Tweets are not updating. What can I do?

This normally happens if there is an SSL problem. Try going to the settings page and switching off SSL validation.

If this doesn’t solve the problem, check your Twitter API key settings.

If neither of these approaches work, Rotating Tweets will normally be reporting the error as a comment in the HTML of your page. This should give you an idea of how to solve the problem.

The Rotating Tweets are not rotating. What can I do?

This normally happens if there is more than one copy of jQuery installed on a page – or more than one copy of jQuery.cycle.

To see if this is the case, search the HTML on your website to see if either script is called more than once. To do this:

  1. Open the page.
  2. Right click and select ‘View Page Source’ or ‘View Source’
  3. Hit [CTRL]+F and search for jquery
  4. Look out for lines that contain jquery.min.js or jquery.cycle.all.min.js. Neither script should appear more than once.

The problem is that the second (or third) copy of the script overwrites all previous versions and the scripts that go with them. This is particularly likely to happen with old templates or plug-ins.

If this is the case:

  1. Check is that you have upgraded your template or your plug-in to the latest version.
  2. If this still doesn’t work, please let me know which plug-in or template is causing the problem and I’ll see if I can build a fix into the next version of Rotating Tweets.

If there is only one copy of jquery and of jquery.cycle on your page, the best way to look for the problem is to open the ‘console’. To do this:

  1. Press [F12] (in Chrome or IE) or [CTRL]+[SHIFT]+K (in Firefox)
  2. Load the page where you have a problem
  3. In Chrome or IE, select the tab marked ‘console’.
  4. Read the diagnostics and look for any problems that relate to JavaScript. This will normally tell you which JavaScript (if any) is having problems.
What can I do if I get the WordPress error code: `http_request_failed – name lookup timed out`?

Try installing the Core Control plug-in and disabling cURL. You can read more about the problem via this support page.

Thank you to darkiko for sharing their solution to this problem.

My widget is too wide!

Try putting:

div.widget_rotatingtweets_widget, div.rotatingtweet, div.widget_rotatingtweets_widget div.widget-title {
    max-width: 123px;

into your CSS – changing 123px; to the width you’re aiming at – either via putting rotatingtweets.css into wp-content/uploads or by editing your own template files.

How can I add a Twitter bird to the left of my tweets?

You can do this by going to the rotatingtweets/css directory and renaming rotatingtweets-sample.css to rotatingtweets.css and putting it in the wp-content/uploads/ directory. This displays a Twitter bird to the left of your tweets. Any CSS you put into rotatingtweets.css won’t be overwritten when the plug-in is upgraded to the latest version.


Awesome Plugin

Sagar Nangare

I used many twitter plugins in the past but this one is very easy plugin to handle. UI is awesome and options for displaying tweets are also great.

Read all 65 reviews




  • Switches off Twitter JavaScript if ‘Do Not Track’ is enabled.
  • Fix minor bug with Selective Refresh.


  • Fixing minor bug in German translation.
  • Removing “Undefined variable” notice on line 165


  • Add shortcode for a large Twitter ‘follow’ button
  • Support for PHP7
  • Support for ‘Selective Refresh’
  • Ensuring show_media display links respects links_in_new_window variable.


  • Updated JavaScript for plug-ins and themes with their own JQuery Cycle2 installations


  • Fixed ‘Invalid argument’ bug when combining tweets from different accounts
  • Allow up to 60 tweets
  • Deletion of Italian .mo file – since now available as a WordPress-hosted translation pack


  • Fixed ‘Undefined variable’ bug in line 648


  • Fixed “no updating” caching bug


  • Better handling of multiple screen names in a single widget or shortcode
  • Addition of new option to hide CSS
  • Updated Twitter JavaScript
  • Translated the base readme file into US English
  • Handled bug with UTF8MB4 text encoding
  • Tidier date management code with better error handling
  • Made links in the readme.txt language independent


  • Reinstalling translation packs. Turns out that incomplete packs aren’t loaded – which breaks some of the available translations.



  • Fixed undefined variable error for show_media in WP_DEBUG mode
  • Fix for caching bug


  • Fixing bug on displaying meta content
  • Enabling sorting of display elements via rtw_display_order shortcode



  • Adds profile_image_size, shuffle and merge_cache shortcode variables
  • Lowers chance of clashes with other installations of cycle2 – by defaulting autoSelector to .rotatingtweets instead of .cycle-slideshow
  • Handles old versions of jQuery that don’t fully support .data() better
  • Fixes bug with merge functionality
  • Fixes bug with admin page JavaScript (thanks to this very helpful article on


  • Updated version 2 of JavaScript – updated jQuery.cycle2 and removal of bug
  • Fixing height bug
  • Fixing Carousel defaults
  • Updating .pot file


  • Completion of Spanish translation – many thanks to Alberto Lario for his help on this
  • Fixing tweet height JavaScript bug
  • CSS tidying for TwentyFifteen template
  • Experimental function combining historical and current tweets


  • Move to using HTML5 custom data attributes and data() functions to transfer variable values to version 1 of JavaScript – including ‘speed’ variable
  • Addition of ‘pager’ via show_meta_pager and show_meta_pager_blob variables
  • Addition of rtw_hashtag_link class to hashtag links
  • timeout=0 now allows continuous scrolling
  • Updating object code for the widget


  • Fixing Tweet timezone display problem
  • Restoring Tweet time display by default for ‘Official Twitter Guidelines (wide)’
  • Extra CSS added to enable people to hide links (should they want to)
  • Option to switch off JavaScript (for advanced users only)


  • Solves bug when Base64 tries to decode an array


  • Better handling transients on transition from old version to new


  • Addition of Italian language
  • Fixes transient-based caching – many thanks to to jensnilsson and Moondrop for highlighting the solution here.


  • Much faster and more reliable caching.
  • Compatibility with W3 Total Cache.
  • New scrollLeftGap transition
  • Ability to put ‘prev’ and ‘next’ buttons before and after the main rotating tweets


  • Ensures all images use https:// link for compatibility with SSL-secured sites


  • Adds show_tco_link shortcode variable to allow people to show
  • Support for Newswire template
  • Restores the caching of Tweet co-ordinates


  • Switches off JavaScript expansion of ‘expand’ to ‘reply retweet favorite’ for carousel rotation.
  • Adds new insidebottom option for np_pos shortcode variable


  • Improved CSS support for horizontal carousel scrolling


  • Adding offset, speed, tweet_length, no_emoji and show_media options to the shortcode
  • Solves clash with Cyclone Slider 2
  • Adds script version details to the JavaScript
  • Removal of excess spaces from middot shortcode option
  • Adds option for ‘custom’ display layout with user-defined display function rotatingtweets_display_override()


  • Fixing cache bug with ‘user_mentions’


  • New code to shrink size of cache by about 70%


  • Bug fix.


  • Shrinking cache size to reduce memory problems.
  • Improved diagnostics.
  • Clarified instructions.


  • Fix next/prev buttons for v. 2 of Javascript.
  • Add next/prev np_pos='tweets' option to documentation.
  • Fix bug on admin page when WP_DEBUG is set.


  • Corrected the 16×16 icon to the latest Twitter logo.


  • Language update including new Serbian translation. Solved an unusual styling problem.


  • Bug fix when user name not recognized.


  • Add option to shorten default link length to 20 characters
  • Language update including new German translation from Nils Kroneberg
  • Updated Brazilian Portuguese translation from Wilmerson Felipe


  • Fixing bug for PHP installations that don’t support the ‘u’ modifier
  • Renaming v2 JavaScript to avoid clash with other plug-ins.
  • Extra diagnostics put in to solve regular expression problem


  • Move to a more unique class name to avoid clashes with another template.


  • New support for reading from multiple accounts
  • Improved clean-up on uninstallation or deactivation
  • Addition of settings page option for timeout of connection to Twitter
  • Addition of settings page option for placement of JavaScript at the bottom of the page
  • Addition of settings page option for duration of cache
  • Fixed problem with hashtags and accents
  • Improved error messages for connection problems
  • Tidying up settings page text


  • Enforce rules on replies and retweets even if the Twitter API doesn’t
  • Fixed problem with Magazino template
  • Fixed incorrect message on settings page


  • Added Carousel rotation option and beta support for version 2 of JQuery Cycle
  • Added link_all_text shortcode tag and functionality
  • Added richer debug information
  • Corrected API expiry date
  • Added missing alt tag
  • Kept CSS permanently in the header to maintain HTML capability
  • Public facing Dutch translation complete – many thanks to Natasja Weijer for her help on this
  • Attempt to fix clash with Avada and Gleam themes


  • HTML5 compliance
  • Improved rate-limiting


  • Addition of Brazilian Portuguese translation
  • Addition of new display format 6


  • Deletes old cache entries if unused for more than 30 days
  • Fixes a jQuery cycle clash with the Oxygen theme.
  • Added readme.txt instructions for dealing with the WordPress error code: http_request_failed - name lookup timed out.


  • Adds an option to switch off verification of SSL connections to Twitter
  • Adds a short code option (no_rotate) to switch off rotation


  • Removes two lines of CSS causing formatting problems
  • Improves responsiveness going from narrow to wider layouts


  • Corrected minor error with resizing of .rtw_meta div



  • Support for search, favorites and lists via Rotating Tweets widgets.


  • Improved and clearer error messages.
  • Removed search bug.
  • ‘Next’ and ‘Prev’ buttons for shortcodes.


  • Adds the opportunity to show lists.
  • Tackles a very odd box height problem that has just appeared in Chrome (but not Firefox or IE).


  • Making sure hashtags have a space or the start of a line before them.
  • Tidying up errors found when running plug-in with wp_debug set to true


  • Minor correction to hashtag code


  • Fixes accents in hashtags (hopefully).
  • Adds beta of search to the shortcode API.
  • Adds new format of Tweet display.


  • Strips @ from screen names to avoid API problems.


  • Removes accents from screen names (and otherwise cleans them up).
  • Add test option (currently for shortcodes only) to access favorites.
  • Solves clash between PECL OAuth library and the Rotating Tweets OAuth library.


  • Supports cyrillic hashtags!


  • Fixed hashtag links


0.712 (1.3.8)

  • Fixed bug with console.log javascript on IE.

0.711 (1.3.7)

  • Fixed up a significant problem with caching.

0.709 (1.3.6)

  • Tidying up error reporting.

0.707 (1.3.5)

  • Fixes major bug resulting from upgrade to handle Twitter API v 1.1

0.706 (1.3.4)

  • Change to JavaScript to improve width handling for tweets.

0.703 (1.3.3)

  • Minor code tidying to improve debugging and increase speed!

0.702 (1.3.2)

  • Adjustment to javascript and CSS to cope with long links or long words

0.701 (1.3.1)

  • Very minor mistake in rendering code

0.700 (1.3.0)

  • Important upgrade needed for Rotating Tweets to keep working after March 2013. Supports version 1.1 of the Twitter API.

0.625 (1.2.4)

  • Enabled users to make all links open in a new tab or window

0.623 (1.2.3)

  • Fixed a problem where a short name fitted inside a long one – e.g. @rotary and @rotarycrocus

0.622 (1.2.2)

  • Escaped title tags

0.621 (1.2.1)

  • Fixed timezone problem.

0.620 (1.2.0)

  • Added option to show links in a new window
  • Fix problem with selection of 20 second rotating speed.

0.613 (1.1.6)

  • Fixed instructions in plug-ins list.

0.612 (1.1.5)

  • Fixed error message caused by last fix causing tweets to repeat.

0.611 (1.1.4)

  • Finally ran with debug and removed all the error messages.

0.610 (1.1.3)

  • Starts to add options to allow for different length URLs

0.602 (1.1.2)

  • Fixes bug with Javascript

0.601 (1.1.1)

  • Fixes problem with stylesheet

0.600 (1.1.0)

*Now includes options consistent with Twitter display options
* Tidied up code.

0.505 (1.0.0)

  • Minimized Javascript.
  • Set-up for I18n.

0.502 (0.4.1)

  • Javascript fix for zero height tweets problem

0.500 (0.4.0)

  • Adds options for how tweet information is displayed and how the tweet rotates.

0.492 (0.3.1)

  • Solves Cannot use string offset as an array error on line 232

0.491 (0.3.0)

  • Lets you customize the Twitter ‘follow’ button.
  • Fixes problem with media links.
  • Sorts problem of overlong links reshaping widgets.

0.48 (0.2.6)

  • More detailed error messages for WordPress installations unable to access Twitter.
  • Fixes problem on the zeeBizzCard template and sets up fix for other templates that use their own install of the jquery-cycle javascript.

0.471 (0.2.5)

  • Making sure that cache never gets overwritten unless new, valid twitter data has been downloaded.
  • Dealing with the problem that someone in a long conversation may not get enough valid tweets to show by asking for only 20 tweets from Twitter.

0.46 (0.2.4)

  • Properly handles rate-limiting by Twitter

0.44 (0.2.3)

  • Removes follow button if Twitter has returned an empty value

0.43 (0.2.2)

  • Improved error checking if Twitter has returned an empty value

0.42 (0.2.1)

  • Fixed major bug causing crashes when Twitter goes down

0.40 (0.2.0)

  • Added ability to alter speed of rotation

0.30 (0.1.8)

  • Fixes bug – problem with get_object_vars() on line 193

0.29 (0.1.7)

  • Better handling of retweets. No longer cuts off the end of the text on longer RTs.

0.28 (0.1.6)

  • Properly fixes flaw in how flags are handled.

0.27 (0.1.5)

  • Fixed flaw in how flags are handled.

0.26 (0.1.4)

  • Stops display and caching of non-existent twitter feeds

0.25 (0.1.3)

  • Stops display and caching of faulty twitter feeds

0.21 (0.1.2)

  • Replaced a missing </div> in the follow-button code (with thanks to jacobp for spotting it and suggesting a fix)

0.2 (0.1.1)

  • Fixed a problem with caching

0.1 (0.1.0)

  • First published version

Contributors & Developers

This is open source software. The following people have contributed to this plugin.


Browse the code