Change the default links *before* you install WordPress

30 April 2010 · 5 comments

You can change the default text for a new install of WordPress if you just know where to look. This Post explains where to find those defaults.

One way and another I install WordPress a lot. I have my own sites, client sites, test sites, demo sites, and even training sites.

Default Blogroll.

Default Blogroll.

I have the installs down to a fine art, except for just one thing: the default list of 7 links, or Blogroll.

The other evening, setting up a site for a training course I’m running soon, I finally snapped. It’s easy enough to delete the default Blogroll, but then I also want to add in my own sites, and that’s just tedious.

It was finally time to figure out where the darned things come from and ‘fix’ it before I do the next install.

The links are in upgrade.php

A default link.

A default link.

After some hunting round I found lines 148 to 183 in /wp-admin/includes/upgrade.php.

In that section of the core WordPress file the default Blogroll links are specified. Carefully substitute your own links before installing.

For example, in my case, I want a link to KnowIT, rather than the Documentation link my screenshot shows:

$default_links[] = array( 'link_url' => 'http://knowit.co.nz/',
 'link_name' => 'KnowIT',
 'link_rss' => '',
 'link_notes' => '');
My new set of Links.

My new set of Links.

Replace each link_url and link_name as required.

If you want fewer than 7 links delete the extra ‘blocks’. Each ‘block’ is clearly demarcated with $default_links[] at the start and 'link_notes' =>''); at the end.

Change other defaults

Don’t like to call the list of links a Blogroll? Take a look at lines 128 to 131 of upgrade.php.

Don’t want the Hello World post or First Comment, or the About Page? Take a look at the lines between 190 and 267. You’ll see where those items are included.

To change them, just replace the wording in the file with your own text.

I ferreted out this information after doing my most recent install, so I haven’t actually tested it out yet. Let us know in the Comments how you get on.

5 comments

Tell us what you think.
Note: there may be a delay before your comment appears. I now approve all comments from new visitors, in an attempt to keep spam at bay.

Chris 17 July 2010 at 12:49 27

Thanks for helping me change the Blogroll. Saved me a lot of time looking.

Reply

Miraz Jordan 17 July 2010 at 17:07 06

Glad that was helpful Chris. Have fun with WordPress.

Reply

DV 03 October 2010 at 08:19 18

this is cool, thanks! also works with wp ms 3.0.1! ;)

I’ve tried lots of plugins to get this correct with new accounts on wp ms, but this one actually worked! so simple but it works.

Reply

Sussie 21 March 2011 at 06:40 40

Hmm… what if I already installed WordPress…??? What can I do then?

Please help?

Kind regards,
Sussie

Reply

Miraz 21 March 2011 at 07:17 37

If you’ve already installed then just delete the unwanted links.

Reply

Add your Comment

Older Post:

Newer Post: