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?

1 Answer 1


Use wp_insert_link().


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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