Skip navigation

Creating a “Bad Code Day” Error Message for Your Blog

I am a fan of fun 404 Page Error pages. I also like entertaining messages for readers when blogs or websites take a “bad day off”. I’ve created such a page for my main site to put up when things go bork in the code to let people know what is happening. It also acts as a place holder until things get fixed.

Which is what WordPress.com developers have done. With all the seriousness that abounds around WordPress, there is a lighter side and I thought I’d entertain you with the entertaining results that smack you in the face when WordPress.com bloggers suffer from server errors, problems, or downtime.

Confessions Of A Server

OH MY! Life is so unfair! What did I do wrong to be born a server in this day and age? I could have been a nice simple bicycle that people happily rode around on all day. But no, I’m stuck inside this metal case serving web pages instead. I never even see the light of day and all I can hear is the rush of the air-conditioning!
Well, no more! I’m relaxing here with a cup of tea and a biscuit until someone shows me some love and attention.

It never takes them long to fix me when I kick up a fuss so check back in a few minutes and I’ll be chugging along merrily again.!

Signed,
The WordPress.com web server
(WordPress.com – where even the machines have life!)

Wordpresscom - Life is unfair server error message

Creating Your Own “Site Down” Message for Your WordPress Blog

While the above serves as the general notice of things going awry for WordPress.com bloggers, you can create your own cute notification for your fans on your full version of WordPress. This is really helpful not only when your database or server goes a little screwy, but when you are modifying a WordPress Theme or running into trouble with a WordPress Plugin.

The error message file will be saved as a backup in your root directory on your site, so you can quickly change the file name so it will appear when people visit your borked site, then quickly change it back to let them see the recovered, and working perfectly, WordPress blog when you’re done fixing.

These instructions assume that you are familiar with accessing your site server, ftp, and basic HTML/XHTML.

  1. View your home/main page in your browser.
  2. From the browser toolbar, choose VIEW > SOURCE (or some approximation) to view the source code of the page.
  3. Copy the entire page of code (for Windows: Ctrl+A selects all, and Ctrl+C copies) and paste it into a text only editor (not word processing program).
  4. Go through the source code of the generated page and remove all links to javascripts and plugins, if you don’t need them to generate just the single page. Just delete them.
  5. Move down to the DIV that contains your main content section such as <div id="content"> and delete all the post content in that section, down to the ending DIV for your content section. Take care to leave all appropriate DIVs and style references in place, per the example below.
  6. Replace it with some content that explains what may be going on, using your normal blog layout styles, such as:
    <div id="content">
    <div class="excerpt-post">
    <h2>Sorry, The Site is Currently Under Repair</h2>
    <div class="entry">
    <p>We apologize for the inconvenience but our site is 
    currently under repair, usually due to maintenance by our 
    host server. We're are yelling and screaming and emailing 
    furiously to insist that they fix this as soon as possible, 
    and hopefully everything will be back up and running smoothly, 
    and better, if they did it right.</p>
    <p>Again, we apologize. Trust us. This is hurting us more 
    than you.</p>
    </div> <!--end of entry -->
     </div><!-- end of excerpt-post -->
    </div><!-- end content -->
  7. Save the page as indexbork.php or indexbork.html and upload it to your root WordPress blog directory. Type in the exact address to the page, such as http://www.example.com/indexbork.php to view the page in your browser. Make sure it looks and says what you want it to say. Adjust it if necessary and upload it again.
  8. To test it, rename index.php to index.bak, then rename indexbork.php to index.php. Type in the root address for your website in your browser and see what appears. If it is your test page, then it works. If it isn’t, check where you put the files and how they are spelled. If it is right, then reverse the renaming procedure to restore your original index.php and indexbork.php file.

Now, when you encounter website trouble, which happens, your fans will still be impressed that you cared enough to send the limited but very best to let them know that you know something is wrong and that you are working on it. Once the repair is finished, rename your files back to what they were and go on. Leave the indexbork.php file there, just in case you may need it in the future.

If your sidebar contains WordPress Plugins such as most recent posts, most recent comments, or anything that will generate a code error when the page is generated without an active and fully functioning WordPress or database, remove those references from the error message page to ensure the page functions without errors.

This method assumes that you want the resulting error message page to resemble your blog. If you don’t care, you can play around and design your own page with any amusing graphics or information, while still letting your readers know you’ll be back to normal very soon. Enjoy!

Digg Digg | Del.icio.us Del.icio.us | Blinklist BlinkList | Furl Furl
Spurl Spurl | Reddit | Add to Simpy Simpy | Add to RawSugar RawSugar


Site Search Tags: , , , , , , , , , , ,
Copyright Lorelle VanFossen

9 Comments

  1. Posted March 13, 2006 at 12:01 pm | Permalink

    Hi lorelle, sorry about an unrelated comment. I am planning to move out from wordpress.com to a full version wordpress. Is there a way to replicate my wordpress.com blog in my full version wordpress blog? I’ve extensively searched but nothing seems to answer my issue :(

  2. Posted March 13, 2006 at 12:36 pm | Permalink

    Haven’t I written about this? I thought I did but I’m coming up empty on my searches. I’ll try to write this up in the next week or so.

    There are several ways. The easiest for you is to contact WordPress.com support through the feedback button requesting a database “dump” (SQL backup works, too) of your blog, but don’t expect a fast or positive response since there are now so many such requests. This was the original answer when this was asked in the early days. With the database file, you can import your WordPress.com blog into the latest version of WordPress, I hope.

    Another method that might be a little overwhelming at first but is fairly easy to do is well described from a post in the WordPress.com Forum on Moving from WordPress.com to Local Installation:

    In your options panel, you can specify the number of last N posts that are to be shown in your RSS feed. You can also set your RSS feed to display whole post rather than an excerpt/summary. Then you can just save the feed like any other XML file, that can serve as your backup. When you want to import it in your WordPress installation, just use the RSS Importer available in the package & import all your RSS backups that you made. Its simple. :)

    It won’t grab your comments, but you can do the same with your comments feed and import those into the database, though I’m not so clear on that method. I’ll do more digging and post something soon.

  3. Posted March 13, 2006 at 9:17 pm | Permalink

    Yes, I think writing a post on it would be a great idea, as it would be an immense help for newbies like us :P

    I can’t possibly express my gratitude at your response. Thanks a lot. I tried the RSS export/import thingy, and it smoothly imported all my posts and preserved the categories as well. However as you mentioned — it doesn’t support comments. As I see it, comments form an integral part of one’s blog. I can’t possibly do away with so many animated discussions I had with the readers who had commented. Losing all that would be a really heavy price to pay.

    I have sent a feedback on the personal sql backup though. I hope they respond soon. And once again, a bunch of thanks!

    ps: eagerly waiting for your post on the comments import through comment feeds. (in the meantime could you give me any pointers? I’m willing to do some experimentation on my own as an act of desperation :D )

  4. Posted March 13, 2006 at 9:36 pm | Permalink

    Not intending to spam, but couldn’t resist but share this find. Though it doesn’t support URL,email and IP of commenters. Were you referring to this approach?

  5. Posted March 13, 2006 at 9:54 pm | Permalink

    Similar instructions for comments were in the WordPress.com forum discussion on exporting WordPress.com. Let me know how the comments feed import works for you. That will be an unusual import.

  6. Posted March 14, 2006 at 12:11 am | Permalink

    I tried out the comments feed import(from the link that I mentioned before). And rightly said, it’s an unusual import — more so in terms of the result: all the comments got imported, but the comment count for each post still shows zero (although you could clearly see all the comments in that post). (check my wordpress.com blog and the personal host blog).

    Weird :S

  7. Posted March 14, 2006 at 7:23 am | Permalink

    You got the comments in, which is great! I haven’t tried that import yet so this is good news. As for the comment count, this sounds really familiar and I’m sifting through my brain to remember, but hit up the WordPress Support Forum because someone there will know faster than I can remember right now. I think it has to do with the calculation number created and added to the database at the time of the posting with WordPress, but I don’t know how to fix that. Let me know, and thanks!

  8. Posted March 14, 2006 at 11:11 pm | Permalink

    I discovered a workaround, it’s a brute force method though. I wrote a query to turn all imported comments into unmoderated (comment_approved=0). And then from the admin panel I approved all the comment (by selecting all approve). Voila, the comment count now shows :D. So probably this is a bug in wordpress.

    So barring the absense of email and IP information of old commenters, I have everything. I can do with that trade off :D

    And finally, thanks for the support :)

  9. Posted March 15, 2006 at 6:59 am | Permalink

    I’ll look more into this, BD. I’m glad you got it figured out. Three stars for that! WEEE!


3 Trackbacks/Pingbacks

  1. [...] A 404 msg for WP (tags: WP) [...]

  2. […] Creating a “Bad Code Day” Error Message for Your Blog […]

  3. […] Creating a "Bad Code Day" Error Message for Your Blog […]

Post a Comment

Follow

Get every new post delivered to your Inbox.

Join 19,715 other followers

%d bloggers like this: