(The quickest way to register)

Blog

Adding ratings to your website

Some of you may have noticed the rating symbols shown next to external links on our website and the small tooltip that links to the target site's reputation scorecard. Now you can add these to your website as well using the small web widget we created.

To add the widget to your website, simply insert the following snippet to your site's source code and let the widget take care of the rest:

<script type="text/javascript"
src="http://api.mywot.com/widgets/ratings.js"></script>

Note: it's advisable to add script elements to the end of the web page to prevent them from slowing down the page loading.

We have also included some options that let you customize where and how the ratings are displayed. This makes it possible to add ratings only to parts of your site, such as links posted in blog comments, for example.

Controlling where ratings are shown

Ratings are added to all external links on the page unless instructed otherwise. You can limit the ratings to only some of the links by defining one or more options as follows:

var wot_rating_options = {
option_1: value,
...
option_N: value
};

The widget currently supports the following options:

selector

Defines a CSS selector. The widget adds ratings for any link that matches this selector.

Example: If your page has a HTML element with an id attribute "comments" and you want to limit ratings only to links inside that element, set the selector option as follows:

var wot_rating_options = {
selector: "#comments a[href]"
};

exclude

Defines a regular expression. Ratings are not shown for links where the hostname matches this expression.

Example: If your page has links to the domain example.com and you don't want to show ratings for these links, set the exclude option as follows:

var wot_rating_options = {
exclude: /^(.+\.)*example\.com$/i
};

exclass

Defines an element class. Ratings are not shown for links that belong to this class. This option has the default value "wot-exclude".

Example: If your page has links matching the selector option above who belong to the class "norating" and you don't want to show ratings for them, set the exclass option as follows:

var wot_rating_options = {
exclass: "norating"
};

exchildren

Defines a CSS selector. If the link matching the selector option has one or more child elements matching this selector, ratings are not shown for the link. This option has the default value "img", which removes ratings from image links.

Example: If you don't want to show ratings for links that have a child element of type img or div, set the exchildren option as follows:

var wot_rating_options = {
exchildren: "img, div"
};

updateinterval

Defines an interval in milliseconds. If your page has dynamically added links and you want ratings to appear for them too, you'll need to define how often the widget should look for new links and update the ratings.

Example: If you want the widget to check for missing ratings once a second, set the updateinterval option as follows:

var wot_rating_options = {
updateinterval: 1000
};

Example: Blogger

We created a sample blog that shows how to add the widget to your Blogger pages.

1. Click the "Customize" link on your blog.
2. Click the "Edit HTML" link on the Layout page.
3. Scroll down the "Edit Template" field until you find the </head> tag.
4. Copy and paste the following snippet just before the tag:

<script type="text/javascript">
var wot_rating_options = {
selector: ".post-body a[href], .comment-body a[href]"
};
</script>
<script type="text/javascript"
src="http://api.mywot.com/widgets/ratings.js"></script>

This adds ratings to your blog posts and user comments. If you only want to show them for user comments, set the selector option to ".comment-body a[href]".

Questions?

If you have any questions about using the widget on your website, post a comment below.

Trackback URL for this post:

http://www.mywot.com/en/trackback/1293

Comments

  1. User picture
    • anandnav on Fri 13 Jun 2008
    • 02:14:50 PM UTC

    This is just what I was waiting for :)

    Wow very easy to integrate into my website :D
    It was just what I was waiting for!

    Hope it will someday come on PHP and SMF forums too :)
    But thanks a lot really to all WOT team :D

    Best regards,
    Anand

    • User picture
      • Link. on Thu 06 Aug 2009
      • 06:19:14 PM UTC

      WOT Integration with SMF

      Well, it came to SMF forums. :)
      http://www.mywot.com/en/forum/4092-wot-integration...

      -Link
      The Ninja's Hideout

      • User picture
        • mr bobby396 on Sat 08 Aug 2009
        • 09:54:02 PM UTC

        Link

        Thanks you iam new and need all the help i can get

    • User picture
      • carlmccall on Fri 06 Aug 2010
      • 07:08:56 PM UTC

      Works on SMF too!

      I added the WOT widget code to my SMF Forum with the built in template editor - took me 2 minutes! For any theme EXCEPT the default theme here are instructions on how to proceed:

      •   First: Go to your Admin section
      •   In the Configuration section click on the Themes and Layout link
      •   Click on the rightmost tab that says "MODIFY THEMES" (above the controls)
      •   You want to edit the index.html file of the theme you are using .... "Edit Theme - index.template.php"
      •   USUALLY it is in the 4th white block down ... at the top of that section it usually starts with "function template_main_below()"
        look for the Div (Division) tag ... down where the Copyright and logos at the bottom of the page (every page) are generated.
        I pasted the javascript code right after the spot where I'd already stuck in the "Honeypot" code. (Invisible traps for bad robots to step in).
      •   look for these words

        // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
        echo '
        <div align="center">

      •   Now: Insert a blank line RIGHT THERE after that DIV tag and paste the Wiget's Javascript code (as seen above: on this page at the top) in there on that blank line ...
      •   Make sure you click the "Save Changes" button at the bottom of the edit boxes.

      And that is ALL you need to do! ALL the external links shown on your site have WOT ratings RIGHT THERE.

      (I'm stoked. I'm going to crawl my own SMF forum site now and kill any links that aren't green! I NEEDED THIS for MY Site! THANKS WOT Developers!)

    • User picture
      • gflex16 on Wed 07 Sep 2011
      • 02:19:19 PM UTC

      RE: This is just what I was waiting for :)

      guess u can do it

      peace

  2. User picture
    • kathy on Fri 27 Jun 2008
    • 01:42:06 AM UTC

    never used before

    I never used this before.
    Is it really save to use.

  3. User picture
    • cotojo on Fri 27 Jun 2008
    • 08:14:01 AM UTC

    Very Useful

    This would be a very useful addition for many blog owners as well as site owners.
    Any possibility of having a HTML version as some blog platforms do not support the use of javascript?

    Colin
    http://cotojo.wordpress.com - Free PC Security

    • User picture
      • Sami on Sat 28 Jun 2008
      • 06:56:59 AM UTC

      Re: Very Useful

      Sorry, it's not possible to implement the widget only using HTML.

      • User picture
        • ShadowSlider on Sat 02 Aug 2008
        • 06:25:40 PM UTC

        plain html vs. java script

        it is true, the widgets will not show if the single user has deactivated java script for his/her sites. But you could use a single graphic of the widget you like to use and link it to WOT. In that case you would not have to use java or any other scripts. I myself have usually a strict no java scipt policy but have the chances, using NO SCRIPT version 1.7.7. for Firefox (add on tool) to decide whether I want to fully, partly, temporary etc. permit java for certain (trusted) sites, so as to make use of the things behind the special java. It is very useful. Even wit restricted java on a site, it will show that some java is expected running on such site and you just have to click on the disabled area to permit java so to get the logo or what ever is behind. To disable java a 100% is useful only, if you want to surfe the internet with a 99,9% of anonymity. There are certain anonymising tools (about 30 Euro per anno) that will not give away any sensible information of your sites surfing the net.
        So I think, because of lack of java scripting on your site to use the WOT logo as an ordinary plain html graphic insert with a informative short text part to it should satisfy your needs as well. All you got to do: just try it and see whether it is to your liking.

  4. User picture
    • cocutzamisca on Sun 15 Mar 2009
    • 09:47:19 PM UTC

    Very usefull

    I added it ti my both blogger blogs.Thank you.

  5. User picture
    • Thirteenth on Tue 31 Mar 2009
    • 04:06:47 PM UTC

    Works

    It works, but I can't understand, how to add two excluded domains. I try to do it like this, but it doesn't work:

    var wot_rating_options = {
    selector: "a[href]"
    exclude: /^(.+\.)*test\.com$/i
    exclude: /^(.+\.)*example\.net$/i
    };

    IPB and Wordpress work marvelously...

    • User picture
      • Sami on Tue 31 Mar 2009
      • 05:00:34 PM UTC

      Re: Works

      You can have only one exclude member for the wot_rating_options object. Try this instead:

      exclude: /^(.+\.)*(test\.com|example\.net)$/i

      • User picture
        • FooSV on Sun 23 Jan 2011
        • 04:54:41 AM UTC

        RE: Re: Works

        Hi Samy, that's all right... but can I ask u something about this?
        How can I add an exclude to a link which contains the word "share*" ???

        It''s useful to add an exclude to links such as facebook.com/sharer* and twitter.com/share* for example.

        I have got:
        var wot_rating_options = {
        exclude: /^(.+\.)*myblogname.blogspot\.com$/i
        };

        How can I add a new exclude option there?

        Can u understand me?

        Sorry about my English., regards from SudAmerica!

        • User picture
          • Sami on Sun 23 Jan 2011
          • 07:55:02 AM UTC

          RE: Re: Works

          You can use JavaScript to add the "wot-exclude" class to those links before loading the widget. If you're using jQuery, something like this perhaps before loading the widget script...?

          $('a[href*="/share"]').addClass("wot-exclude");

          • User picture
            • FooSV on Sun 23 Jan 2011
            • 11:17:29 PM UTC

            RE: Re: Works

            Tks Sami, but I dont know how to use jquery (remember that the most "blogger.com" users hasnt idea about this languajes).
            I fix it this way:

            var wot_rating_options = {
            exclude: /^(.+\.)*myblogname.blogspot\.com*|facebook\.com*|blogger\.com*$/i,
            selector: ".post-body a[href], .comment-body a[href]"

            Anyway, I tried to find whats "/i" means in the "exclude" sentence, but in the WOT API doesnt appear, can u give me a link reference?

            Tks Sami, if I have success with this, I'll write a spanish article about adding WOT in blogger's templates ;)

            Regards, FS

  6. User picture
    • g7w on Tue 31 Mar 2009
    • 05:56:05 PM UTC

    support

    This Blog entry should be added to the Support Page under the Heading:
    Rating Websites
    *> How do I add WOT to my Website, Blog, Forum?
    just a thought...

    -------
    Against Intuition - gives us safety through Web of Trust.
    WOT Community - gives us security through unity.
    Thank you all
    G7W {G.O.M}
    http://g7w.net/

    • User picture
      • Sami on Tue 31 Mar 2009
      • 05:59:51 PM UTC

      Re: support

      It's linked on the Friends page, which has information for the badges and the widget. I hear there are plans to change that though.

  7. User picture
    • Creastery on Tue 21 Apr 2009
    • 02:50:27 PM UTC

    Nice script!

    This is certainly a great script for all to use for their websites! :)

    Thank you and best regards,

    Creastery
    Developer of TechAirlines

    I have currently retired from WOT.

  8. User picture
    • ceealice on Tue 25 Aug 2009
    • 07:22:12 PM UTC

    WOT

    The best warning I have ever found, really depend on it, it tells me I may have a problem before it starts. Do you upgrade? I want to be the first to know..ceealice, I have recommened it to all my friends....

  9. User picture
    • goodsite on Thu 10 Sep 2009
    • 10:37:14 PM UTC

    Open in a new page?

    I want the link open in a target="_blank"

    • User picture
      • Sami on Thu 10 Sep 2009
      • 11:01:58 PM UTC

      Re: Open in a new page?

      Try adding something like this after the widget (assuming you are using jQuery):

      <script type="text/javascript">
        $(document).ready(function() {
          $("#wot-tooltip").attr("target", "_blank");
        });
      </script>

      • User picture
        • goodsite on Fri 11 Sep 2009
        • 08:00:49 AM UTC

        Thanks, but doesn't work.

        Thanks, but doesn't work.

        • User picture
          • Sami on Fri 11 Sep 2009
          • 08:03:50 AM UTC

          Re: Thanks, but doesn't work.

          If you want assistance, you'll need to share a bit more details. Are you using jQuery? If you have Firebug installed, see if the target attribute was added to the #wot-tooltip link properly. If you're not using Firebug, start using Firebug... :)

  10. User picture
    • goodsite on Fri 11 Sep 2009
    • 08:14:28 AM UTC

    Yes i use firebug, and i see

    Yes i use firebug, and i see no adding target. And yes, i use jquery.
    This is my site in base64: d3d3LmVuZmlybWUucm8=
    Please take a look. Thanks again. I realy like this widget, I use wot. And is very usefull.

    • User picture
      • Sami on Fri 11 Sep 2009
      • 08:34:53 AM UTC

      Re: Yes i use firebug, and i see

      You're not using jQuery, you're using prototype. But no problem, the widget adds jQuery to the page in a "no conflict" mode, so you might be able to simply replace $ with jQuery on the code snippet and it might actually work.

      • User picture
        • goodsite on Fri 11 Sep 2009
        • 08:45:01 AM UTC

        Now, it works. Thank you

        Now, it works. Thank you very much.

        • User picture
          • giveaway365.com on Thu 14 Jan 2010
          • 04:28:37 AM UTC

          new window smf

          my website is giveaway365.com
          for smf 1.1.11

          jQuery(document).ready(function() {
          jQuery("#wot-tooltip").attr("target", "_blank");
          });

  11. User picture
    • Glitch on Wed 18 Nov 2009
    • 07:43:08 PM UTC

    vBulletin integration

    Does anyone know how to get this to work only within threads and posts in vbulletin?

    • User picture
      • Sami on Wed 18 Nov 2009
      • 09:40:00 PM UTC

      Re: vBulletin integration

      It depends on your vBulletin version, but basically, just set the selector to match only links inside posts. Something like this might do for vBulletin 4:

        selector: ".postdetails a[href]"

      After a quick peek at some vBulletin 3 forums, I guess something like this might work there:

        selector: ".posts .alt1 a[href]"

      • User picture
        • Glitch on Thu 19 Nov 2009
        • 10:17:48 AM UTC

        Using 3.8.4 and tried that,

        Using 3.8.4 and tried that, but not sure which template to edit to get it to work correctly. It seems to be putting the query in the navbar inks, as well...and I don't want that.