This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.



Displays recent tracks from your account.

Important: Requires PHP 5!


  • Easy to set up via widgets (requires WordPress > 2.8)
  • Displays your current tracks (Listening now)
  • Customizable by template and css (you decide what is displayed)
  • Data is kept locally (default: 45 seconds)
  • English and German localization


If you are using widgets

  • Design → Widgets
  • Drag the widget into your sidebar
  • Configure your username, the number of shown tracks and the template
  • Done

If you are not using widgets

Copy the following PHP code in your template:

<?php wplastfm('username' [, number of tracks [, $options]]); ?>

You can configure the plugin via “wplastfm-settings.php” or via array. E.g.

<?php $options = array("template" => '%track%', "cache" => 45, "trunctrack" => 40, "truncalbum" => 25); ?><h3>Customization</h3>

The plugin provides the following CSS classes:

  • ul.lastfm — the list
  • ul.lastfm li — ul list elements
  • ul.lastfm li a — links
  • ul.lastfm li img — image formatting
  • ul.lastfm li span.lastfm-time — time formatting
  • ul.lastfm li span.lastfm-album — album formatting

If you don’t need the wplastfm.css, you can delete it.


You can change the following settings in the “wplastfm-settings.php” or via array.

  • $wplastfm_options['cache'] – Specifies how long the data is kept locally
  • $wplastfm_options['trunctrack'] / $wplastfm_options['truncalbum'] / $wplastfm_options['truncartist'] / $wplastfm_options['trunctitle'] – Maximum length of the text
  • $wplastfm_options['timeformat'] – Time format for songs played more than 24 hours ago
  • $wplastfm_options['imagesize'] – Image source (small, medium or large)
  • $wplastfm_options['albumcover_height'] – Height of the album cover
  • $wplastfm_options['useartistimage'] – If there is no album cover, the plugin uses the artist image instead (can be true or false)
  • $wplastfm_options['profilelink'] – Displays link to your profile or disables it.
  • $wplastfm_options['template']


  • Example
  • Widget configuration options
  • Example


  1. Upload folder wplastfm to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Done


How to create your own timeformat for tracks played more than 24 hours ago
  • Go to the Widget page in WordPress and choose ‘Use self-defined’ in the dropdown menu.
  • Open the wplastfm-settings.php and edit the $wplastfm_options['timeformat'] variable
  • Done

Contributors & Developers

“WPLastfm” is open source software. The following people have contributed to this plugin.


Translate “WPLastfm” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Bugfix: The time format chose in the dropdown menu is now displayed correctly
  • Added the possiblity to choose the size of the album cover (small, medium, large)
  • Added the option to display or hide the link to your profile in the widget title
  • Timeout for the HTTP request has been reduced (3 seconds for recent tracks, 2 seconds for artist image)


  • Uses the WordPress HTTP API instead of c_url
  • Added template tags for %artist% and %title%
  • Moved the cache files to /cache folder
  • Now uses the artist image, if no album cover exists
  • Some other small improvements and bugfixes.
  • (The WordPress HTTP API doesn’t work properly in 2.8, so please update WordPress)


  • Bugfixes
  • Tested up to WordPress 2.9


  • Fixed error message due PHP 5.3.0 curl bug


  • Added a fixed height for the album cover
  • Added the option to configure the maximum length of the title/album


  • Fixed a problem with the right version number


  • First stable release