Shop Archives Downloads Contact Videos Subscribe Music

Simple steps to a faster Wordpress Dashboard

How to remove The Wordpress Development Blog and Other Wordpress News feeds from your Wordpress dashboard

July 2007 UPDATE: In newer versions of Wordpress, e.g. 2.2, this is really easy now.
In your wp-admin directory, you need to edit the index.php file. Just comment out or delete the following lines:

<div id=”devnews”></div>

<div id=”planetnews”></div>

And your done!

Tired of all that default news stuff that makes the default Wordpress Dashboard so slow to load? I sure was — it was taking 3 to 6 seconds for my Dashboard to load because of all the feeds. By removing the “Other News” and “Wordpress Development Blog,” feeds, my Dashboard now loads in between 0.13 and 0.20 seconds, and I’m a happy camper.

Part 1 shows you how to get rid of ALL the resource-hogging newsy stuff. Part 2 shows you how to keep just the Wordpress Development Blog’s most recent post (in case you want to do that).

[Note: I use Wordpress 2.0.4. Haven't tried other versions. This tested fine in Firefox 1.5.0.7 and IE 6; Validates as XHTML 1.0 Transitional. Been using it myself for a week or so, no problems encountered whatsoever.]

Instructions – Part 1
You have to edit one of Wordpress’s core files here, but it’s a really simple edit. As long as you know how to edit a file in a text editor and upload it to your server, you can do it. All you have to do is comment out some of the code in the index.php file that resides in your wp-admin folder.

1) Go to your wp-admin folder and open index.php in your favorite text editor (Note: it’s always prudent to save a backup copy first!).

2) Scroll down to the following section of code, and “comment out” the entire block of html and, as suggested by Intgod, the php (the comment code you should add is in red):


<!--<p><?php /*_e("Below is the latest news from the official WordPress development blog, click on a title to read the full entry. If you need help with WordPress please see our <a href='http://codex.wordpress.org/'>great documentation</a> or if that doesn't help visit the <a href='http://wordpress.org/support/'>support forums</a>."); ?></p>
<?php
$rss = @fetch_rss('http://wordpress.org/development/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<h3><?php _e('WordPress Development Blog'); ?></h3>
<?php
$rss->items = array_slice($rss->items, 0, 3);
foreach ($rss->items as $item ) {
?>
<h4><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> &#8212; <?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></h4>
<p><?php echo $item['description']; ?></p>
<?php
}
}
?>
<?php
$rss = @fetch_rss('http://planet.wordpress.org/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<div id="planetnews">
<h3><?php _e('Other WordPress News'); ?> <a href="http://planet.wordpress.org/"><?php _e('more'); ?> &raquo;</a></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 20);
foreach ($rss->items as $item ) {
?>
<li><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a></li>
<?php
}
?>
</ul>
</div>
< ?php
}
*/?>-->

3. Don’t mess with any of the other code. Leave it as it is. Save this new version of index.php to your wp-admin folder on your server, overwriting the old copy (you did save a backup of the original, right?).

4. Log into your Dashboard and enjoy the new clean look and über-fast loading time.

Ditch the “Other news,” but keep the most recent post in the “Wordpress Development Blog”.

If you want to keep the Wordpress Development Blog active but limit it to showing you only the first post (say, to stay abreast of any important developments) here is how you do it.

Instructions – part 2

You need to modify the same block of code as in part 1 above (don’t mess with any of the other stuff), but with two important changes:

1. Change the 3 to a 1 in the line below:


$rss->items = array_slice($rss->items, 0, 3); <--- change this 3 to a 1

2. Leave the Wordpress Development Blog section intact and just comment out the “other news” code block instead.

Your final code should look like this (the edits are in red):


<p><?php _e("Below is the latest news from the official WordPress development blog, click on a title to read the full entry. If you need help with WordPress please see our <a href='http://codex.wordpress.org/'>great documentation</a> or if that doesn't help visit the <a href='http://wordpress.org/support/'>support forums</a>."); ?></p>
<?php
$rss = @fetch_rss('http://wordpress.org/development/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<h3><?php _e('WordPress Development Blog'); ?></h3>
<?php
$rss->items = array_slice($rss->items, 0, 1 );
foreach ($rss->items as $item ) {
?>
<h4><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> &#8212; <?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></h4>
<p><?php echo $item['description']; ?></p>
<?php
}
}
?>
<?php /*
$rss = @fetch_rss('http://planet.wordpress.org/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<div id="planetnews">
<h3><?php _e('Other WordPress News'); ?> <a href="http://planet.wordpress.org/"><?php _e('more'); ?> &raquo;</a></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 20);
foreach ($rss->items as $item ) {
?>
<li><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
*/?>

There you have it! I hope it works for you as well as it’s worked for me. BTW, instead of commenting stuff out, you could probably just delete it. But if you’re feeling squeamish about editing Wordpress core files, it’s probably nice to know that you can easily restore things to normal by deleting the comments.

Popularity: 1% [?]

RSS feed

5 Comments

+ Comment by Kristof
2006-10-06 18:13:09

I’ve got no good idea why your dashboard sped up after these changes. As far as I can see from reading this snippet, you only commented out the rendered HTML, keeping it from rendering in your browser, but the PHP snippet still fetches the remote data, i.e, http://planet.wordpress.org/feed and proceeds to render 20 items from that feed. On the other hand, it’s really been ages since I coded anything useful in PHP and I’ve never actually tried to HTML comment PHP stuff …

To make sure that the PHP code doesn’t get executed, I usually isolate the code I don’t want and move it to a function I like to name “obsoleteSomethingSomething” and leave a comment saying where I relocated the code.

//moved code for … to function obsoleteDefaultRssFeeds()

function obsoleteDefaultRssFeeds()
{
// Your obsolete code here
}

I usually stuff all the old code in that function to prevent it from being executed although it’s still being parsed. Moving it to “obsolete” functions prevents me from going through the hassle of having to comment the script and the html code separately. You should be able to do that very nicely in WP too.

I would make a nicer example but I’m not sure if I can use code tags in the comments.

Anyway: I’m really impressed and intrigued to see you in ubergeek mode …

 
+ Comment by Lori
2006-10-06 20:15:06

Thanks for the tip, Kristof. I definitely don’t identify as a “geek” at all, but on the other hand I’m sure not afraid to dive in and experiment with code and figure stuff out. I considered using // comments to block the php thingies as well, but didn’t see the need because the simple html comments worked fine. So maybe it is some rendering dealie…I can’t explain the massive speed increase either, all I know is that it works!

Maybe I’ll experiment with it and revise the tute — who knows, maybe it would make it even faster :-o

[edit: experimentation done. No noticeable difference in speed with the php commented out, but I went ahead and added to the tute as well, just cuz it makes sense. Thanks, K!]

 
+ Comment by Juan
2006-10-07 00:11:40

Great!:D Now that you’re all geeked up, and if you want to experiment some more, try using this GeSHi plugin for WordPress:

http://www.thedevproject.com/projects/wordpress-geshi-plugin/

It’s just a code syntax hightlight that make’s it more readable ;)

By the way, who won the banana pic contest? I’m dying to know

 
+ Comment by Juan
2006-10-07 00:40:22

Yep, sorry, I misread the contest date. (Yeah, I need a vacation fast)

 
+ Comment by Lori
2006-10-07 09:43:51

Thanks for the tip, Juan. Looks a bit geeky for me, though (i.e., like it would take way too much time for me to learn to use). My BF made me a quick’n'dirty app that converts the naughty code to html entities, and I can then easily just highlight the few bits I want with css. But for serious geeks, that plugin looks pretty cool.

 

Sorry, the comment form is closed at this time.