Create Link Directory in WordPress
Maintaining a list of links on a website is often tedious work, especially if editing the HTML manually.
Many webmasters use automatic link directory creation software to maintain a page (or pages) of links. The problem I have with such software is the distance it creates between the webmaster and their content. Automatic link page creation often leads to low quality linking. Because of the ease of creating a link, the link itself (no matter the value) becomes more important than the quality of the link.
For my Recommended Web Tools Directory page, I use the built-in functionality within WordPress to maintain all my links. It is not a totally automatic process nor is it totally manual. Because there are still several steps involved in creating a link, especially for one in a new category, it forces me to think about whether the value of the link is worth the time and effort to put it on my page. For me, this is a built-in checks and balances system.
There are several ways to create a link directory. What I outline below is just one of those ways. This little tutorial assumes a knowledge of the Page functionality within WordPress. If a step doesn’t make sense refer to my Other Web Resources/Recommended Web Tools Directory page.
For this tutorial, I assume the creation of the link directory from scratch.
- Install the RunPHP plugin. Download and installation instructions can be found here or here. The RunPHP plugin is needed to run PHP from within WordPress Pages.
- Create ‘Directory’ Link Category
On the WordPress menu bar, clicks Links.
Click Link Categories
At the bottom is the “Add a Link Category Section”
Name the Category ‘Directory’
CLick the Description box.
Click Add Category button. - Create the Directory Page.
This page is the equivalent of my Other Resources page.
Click Write on the WordPres menu bar.
Click Write Pages.
Name the Page. For example, mine is called Other Resources.
Add code that will display the ‘Directory’ Link Category.<ul>
<li> <?php _e(‘My Directory’); ?>
<ul>
<?php wp_get_links(X); ?>
</ul>
</li>
</ul>X is the number assigned to the ‘Directory’ Link category.
Click Links
CLick Link Categories
Find the ID number associated with the ‘Directory’ link category.
Enter that value for X.
Save the page. NOTE: The use of a template or any addition content if up to the individual user. This tutorial does not cover such items. Immediately go back and edit the page.
On the Write Page page, under Discussion, check the eval() content check box. This enables the page to use the RunPHP plugin. NOTE: checking the eval() box on the first go around does not seem to work. This is a RunPHP plugin issue.
Save page again.
Create link to this page from the home page. NOTE: this again is up to the individual user. It can be accomplished in a number of ways. - Create Link Category
On the WordPress menu bar, clicks Links.
Click Link Categories
At the bottom is the “Add a Link Category Section”
Name the Category ‘All-time Favorites websites’ (name is user defined. This name is just for tutorial purposes.)
Click the Description box.
Click Add Category button. - Create category page
Typically the Page of the category should be named the same as the link category.Click Write on the WordPres menu bar.
Click Write Pages.
Name the Page: All-Time Favorite Websites
Add code that will display the ‘Directory’ Link Category.<ul>
<li> <?php _e(‘All-Time Favorite Websites’); ?>
<ul>
<?php wp_get_links(X); ?>
</ul>
</li>
</ul>X is the number assigned to the ‘All-time Favorite Websites’ Link category.
Click Links
Click Link Categories
Find the ID number associated with the ‘All-time Favorite Websites’ link category.
Enter that value for X.Save the page. NOTE: The use of a template or any addition content if up to the individual user. This tutorial does not cover such items.
Immediately go back and edit the page.
On the Write Page page, under Discussion, check the eval() content check box. This enables the page to use the runphp plugin.
Note the page slug. Copy and paste it to an empty document for future reference. NOTE: the name of the page slug imitates the name of the WordPress Page. The page slug can be changed. It does not need to read the same as the name of the WordPress Page.
Save page again. - Add link to category link in the Directory link category
On the WordPress menu bar, clicks Links.
Click Add Link
Enter the URI of the link: http://www.yoursite.com/index.php/all-time-favorite-websites
Enter link name: All Time Favorite Websites
Description: Enter a short description about what links are contained in this category.
Category: Choose ‘Directory’
Click Add LinkNote: the URI will be dependent on the permalink structure used on the website.
- Add new link to link category
On the WordPress menu bar, clicks Links.
Click Add Link
Enter the URI of the link: http://www.thisreallycoolwebsite.com
Enter link name: Really Cool Website
Description: Enter a short description about the website.
Category: Choose ‘All Time Favorite Websites’
Click Add Link
Go to the home page.
Click on the directory link that was created
This will open the main directory page
Listed should be the heading ‘My Directory’
Indented under My Directory should be a hyperlink “All Time Favorites Websites”
Below the hyperlink there should be a short description.
Clicking on the “All Time Favorites Websites” hyperlink should open the All Time Favorites Websites page.
Listed should be the heading “all time favorite websites”
Indented should be a hyperlinks to Really Cool Website
Below the hyperlink there should be a short description.
This process is much easier if simply adding a link to an already existing category. Simply follow the directions under Step 7.
If you have any question please email me. I would be happy to provide any support I can. See my Contact page for email details.
Posted by Paul Flyer on Tuesday, August 9th, 2005 in WordPress Help




Kris humor Says:
May 13th, 2007 at 2:51 am
thankyou nice tutor and helped a lot.
davez Says:
August 18th, 2007 at 11:32 pm
Very creative approach to build link directory. Nice job!
Paul Flyer Says:
September 26th, 2007 at 5:50 pm
Thank you and you are welcome!
Jason Says:
August 6th, 2008 at 12:23 am
Paul, thanks for this. I’ve downloaded a plugin by Alec Tang called Link Directory that achieves the same thing, but the link directory created lives in a site subfolder which is linked to from the site front page. Using your method can I have the directory display ON my WordPress front page (i.e. on a specific page that I set as the front page). I’m trying to get a directory to display in that blue box (which is a WordPress page) on my site.
imhaya Says:
November 7th, 2008 at 10:38 am
could we create unlimited sub-directory? for example :
topic
-music
–mp3
—metallica
–video
Daniel Tetreault Says:
December 2nd, 2008 at 9:46 pm
This post totally helps me out! Thanks soooo much.
Daniel.
Internet Marketing Strategies Says:
March 18th, 2009 at 4:20 pm
I love this post! I keep coming back to it over and over again. Your post on creating a link directory in WordPress is amazing.
Thanks,
Daniel.
lena Says:
May 22nd, 2009 at 8:16 am
I have not tested your solution yet
I’m looking a way to also add google map for all link
Bihar Says:
October 2nd, 2009 at 1:34 pm
No doubt, this is an interesting concept. Its amazing how wordpress can be used for various things.
Xcellence It Web Solutions Company Says:
January 8th, 2010 at 7:07 am
hi, nice idea, let me try this, let u know if i face any issues…
thanks
Xcellence IT