Referrer Wordpress Plugin Comments RSS feed

Referrers is a plugin I coded to show the most recent referring urls to a particular post. I had seen the wp-refer plugin from NoPrerequisite but couldn’t put it on my blog without hacking because it uses the meta fields to store its data, and as I display the metadata for other purposes in each post, it would get fairly cluttered.

Also, I am using the very good StatTraq plugin, so I thought I could make use of the fact that it already records referrers.

To install :

  1. Download and install Stattraq.
  2. Download gzip file and uncompress it.
  3. Upload the resulting file to /wp-content/plugins
  4. Activate it in your admin interface

Using it is simple:

Add the following code to your index.php file, within the loop

post_referrers(8, “<li>”, “</li>”, “No referrers”, “self”);

Where ‘8′ is the number of referrers to show, ‘<li>’ is the text to show before each link, ‘</li>’ is the text to showafter each link, ‘No referrers’ is… you guessed it! the text to show when there are no referrers yet and the last option marks the excluded hosts. If you use ’self’, internal referrers only will be hidden. Otherwise, you can write a list of hosts (domain names) to ignore like this: “google.com yahoo.com example. org” and so on…

See it work at the bottom of this page, and leave a comment in case of problems.

Version 0.21 and up use Google redirection to help prevent referrer spam.

En Fran?ais

Liked it? Share it!
  • del.icio.us
  • Facebook
  • Google
  • TwitThis
  • StumbleUpon

13 Responses to “Referrer Wordpress Plugin”

  1. [...] plugin to shows the last few referrers to each post, just like at the bottom of this page. Check it out! Articles similaires Jumble Up! Wordpress PluginStylesheet Choo [...]

  2. [...] ferrer slvShowNewIndicator(1096130516); Filed under: WordPress Plugins|Google it! Referrers is a plugin that shows the most recent referring urls to a particular post. [...]

  3. Thanks for the referrer plugin! I’ve been using Stattraq for a while, so it’s great to be able to tap into all of that data ;-)

  4. [...] file in your post – formatted with line numbers, and a link to download the actual file. Referrer Will show the most recent referring urls to a particular post. [...]

  5. Referrer plugin pour Wordpress
    Je viens de trouver chez JFoucher un moyen d’afficher sous wordpress via le plug in StatTraq, les sites referrers (par lesquels un internaute est arriv?) sur une page d’un blog. La m?thode est enfantine: Installer Stattraq. t?l?charger post_refer…

  6. lee says:

    Why does it show up after each post on my main page?

  7. lee, it sounds like you have the “related posts” bit in the wrong place… Look for the part that says something like “if comments or single” – put it in that section, not on the front page. Sorry – don’t have the templates memorized, but dig around and you’ll see it.

  8. [...] @ 21:47 (Current Mood: ) I like giving props where it s due. So theReferrer Wordpress Plugin is a great way to show off those who send me traffic. Than [...]

  9. [...] ??? ???????
    Filed under: WordPress leepro @ 10:51 pm

    ?????????? referrer???

    Comments [...]

  10. [...] nt not supported – Type: 8 Name: #comment > Polls Post Referrers ent not supported – Type: 8 Name: #comment > StatTraq User [...]

  11. Fletcher says:

    Is it possible to group Post-Referrer? Sometimes my links are like

    index.php?=232

    and sometimes

    /archives/2005/07/slug

    I hope you know what I mean… :-)

  12. Jonathan says:

    Hi Lee,

    You have to put an if condition like this :

    ?php
    if ($single) {
    ?
    ul
    ?php
    post_referrers(10," li "," /li ","Not yet...","self");
    ?>
    /ul
    ?php
    }
    ?

    That will display the referrers only if a single post is shown.

  13. sum1 says:

    well, but also it shows always the same referrers under every post. it doesn’t distinguish between posts. can it also display post-secific referrers and not juast all of them without regard to which post they refer?

Leave a comment

If you register, these will be filled automatically