How to: Create a “Save to Delicious” button

Social bookmarking sites can bring you a huge traffic, but being featured on popular sites as such as Delicious.com isn’t easy. To achieve this goal, here is something to help you: A “Save to Delicious” button.

This recipe is very easy to achieve: Paste the following code within the loop, on your single.php file.

<a href="http://del.icio.us/post?url=<?php the_permalink();?>">Save this link to Delicious</a>

Related Posts

No related posts.

13 Responses

Nov 14 2008 12:16

Well, I always though it involved something more complicated than this. That’s why I like this site, noting is too simple to share.

Nov 14 2008 12:23

Thanks my friend! You’re right, nothing is too simple to be shared as long as it is useful :)

Nov 15 2008 06:26

Isn’t this just a text link and not a button?

Nov 15 2008 09:01

@Chris Berry: Yes, it is a text link, sorry for that mistake! Anyways you should easily display a button instead.

Nov 15 2008 12:36

If you want to automatically fill out title and notes you could use the following:

http://delicious.com/save?jump=yes&url=&title=&notes=

Though, I haven’t found out how to fill out the tags yet.

Nov 15 2008 12:36

Well, WP comment form stripped out the PHP, but you figure out where the_permalink(), the_title() and the_excerpt() go :)

Nov 15 2008 14:04

Thank you Ronny for this useful addition to my post!

Apr 06 2009 22:54

How do i add to a non blog site?

Jul 20 2009 19:05

For the sake of correctness, shouldn’t you escape the permalink? Theoretically it shouldn’t contain an ‘&’ symbol but what if it does in some corner case?

Dec 20 2009 13:37

You really should urlencode the link – otherwise there could be problems with it. here is how i do stuff like this:

function delicious_link(){

global $post;
$link = get_permalink($post->ID);
$url = ‘http://del.icio.us/post?url=’.urlencode($link).’&title=’.urlencode($post->post_title);
return $url;

}

// example call
// <a href="” title=”">bookmark on delicious.com

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required