WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a plugin that I ship with my theme whose function is to jumpstart the process of launching site so that its optimized for the theme. It has all my default pages, plugins, settings, etc...

For example, I'm using the following script to remove the default blogroll links...

$arr_args = array( 'hide_invisible' => 0 );
$arr_links = get_bookmarks( $arr_args );
foreach($arr_links as $obj_link){wp_delete_link($obj_link->link_id);}

However, now I want to create replacement links to go in this listing. I want my social media links to go here.

Basically, I want to create a list of 4-5 links (YouTube, Facebook, Twitter, LinkedIn, etc)

Once I know how to insert bookmark links via script, I can place the css bits in my theme that I need to effect the look.

Any ideas or examples for doing this?

share|improve this question
up vote 1 down vote accepted

Use wp_insert_link().

share|improve this answer
Well that's easy enough. Thanks Toscho! – Scott B Mar 31 '11 at 3:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.