Remove White Space

plugin banner

Removes white space from wp_list_pages and wp_list_categories (nice for IE6 – prevents gaps in vertical lists).

Author:Ben Huson (profile at
WordPress version required:2.8
WordPress version tested:3.4.1
Plugin version:1.0
Added to WordPress repository:30-10-2009
Last updated:10-07-2012
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:
Total downloads:2 000
Active installs:70+
plugin download
Click to start download

This function removes whitespace from the list items outputted by wp_list_pages and wp_list_categories.

This white space can cause layout issues in IE6 and some other browsers such as gaps between each list item even when there is no margin or padding applied.

Simply call wp_list_pages or wp_list_categories as usual:

<?php wp_list_pages(); ?>

To ensure there is no trailing white space around the first and last items, you should remove any white space between you <ul> tags and the PHP function:

<ul><?php wp_list_pages(); ?></ul>