Changing a forgotten WordPress password




May 11th, 2006


What do you do if you have a WordPress blog and you’ve forgotten the password? (This is quite common if you’ve ever clicked the ‘Remember me’ option some time back in the dim and distant past. This works great until you clean out your browser’s cache taking your cookies and your password along with it!)

First of all, don’t Panic! This short post will help you get back into your WordPress blog and get you back blogging.

To make these changes I'm going to assume that you have access to phpMyAdmin and are comfortable using it (making a wrong change here can trash your entire WordPress database!  You have been warned!).

  1. Log into phpMyAdmin.
  2. Click on the Databases link and then click on the database you want to edit from the list that appears.
  3. You will now be faced with a list of tables in that database.  From this point on I'm assuming that you used the default "wp_" prefix for your WordPress tables.
  4. In the right-hand pane scroll down to "wp_users" and click on the "Browse" icon (if you hover over the icons you'll notice a tooltip appear).
    WordPress password reset
  5. You'll now see the list of users for the site.  The Admin will be the user with the ID number 1.  Assuming that’s you, click on the "Edit" icon next to this to edit it (again, hover long enough and you'll see a tooltip appear).
    WordPress password reset
  6. You'll now see all the details associated with the Admin user.  The field that you are interested in is labeled "user_pass".  This field contains the password that have been encoded using the MD5 one-way hash which turns the password that was used into a string that is 32 alphanumeric characters long.  Don't bother trying to reverse the hash back to the password!  Consider the password lost!
  7. Into the "user_pass" field, type in your new password. 
    (REMEMBER THIS PASSWORD!!! )
  8. Now your new password will be not stored in the database as the plain text password you just typed in (which would make it easy to steal) but rather as an MD5 hash of the password. So the next important step is to convert your password.  Fortunately, phpMyAdmin offers a really easy way to do this.  
    From the "Function" field select "MD5".
    WordPress password reset
  9. Once you've made that change, scroll to the bottom of the screen and click "Go".  The password will be hashed using MD5 and stored in the database.
  10. Log out of phpMyAdmin.
  11. One final thing.  If you’re using WordPress 2.0 or higher you’ll need to delete the WordPress cache file.  Using your FTP program (or cPanel file manager) delete all the contents of the /wp-content/cache folder.
  12. Now log into your WordPress blog using the new password and start blogging again!


WordPress Chronological Order …



May 10th, 2006


Today I've lost the plot at least a couple of times...

I've been trying today to sort out Adrian's Drac Ant page over on Antrageous Antics. The page is a WordPress category page (with a little bit of extra formatting that will show only on the Drac Ant category archive).  Simple enough, but what bakes my brain is trying to figure out how to put in meaningful navigation through the pages of Drac Ant cartoons, especially because in this case they correspond to journal entries and dates in the original Bram Stoker book, Dracula. 

Adrian wants a way for the user to quickly get to the earliest entry that was made because, being a daily cartoon site, the site is set to show one cartoon post per day and that means the archives will only show one post per page too (unless of course you know of some way round this, if you do please let me know!)  So getting back to the original entry would take a lot of clicks otherwise.  Luckily the WP-PageNavi plugin puts in a link to the Last page by default if there are more than 3 pages.  But wait a minute shouldn’t that ‘Last’ really be ‘First’?  After all that page contains posts that were posted earlier in time than those on the ‘First’ page, right?

I've used WP-PageNavi many times before but it's never really hit me before today that when it shows [1] [2] [3] » Last  that the ‘Last’ page it’s linking to is really the first chronologically speaking. It's not just this plugin that does it or WordPress - lots of software does it. Just a chronological semantic glitch ... perhaps because so many people, myself included, are still adjusting to websites that handle the page navigation in reverse chronological order. Before the advent of the blog and blogging software this was pretty hard to do manually!(As an aside we were discussing recently the main differences between a blog and a website and I'd have to say that content being arranged chronologically is probably the biggest difference after trackbacks.)

So I edited the plugin (email.php) to swap around  the words First and Last in the code. 

But then it occurred to me that there was something wrong with the WP-PageNavi set as it was in amongst the previous and next entries blocks.
I had to look at it for a little bit before I realized what it was. The little double arrow » on the pagenavi is pointing in the direction of the older posts. But there's also a » on the Next Cartoon link which is pointing to the more recent posts - it should be the other direction! That's it, brain 100% fried. How come I never noticed this before? (Am I having an 'off' day today or a more switched on than usual day???)

So I switched around the the « and » arrows in the template so they pointed the right way:

<div class="alignleft">
<?php previous_posts_link('Next Cartoon &laquo;    |     ') ?>
<?php wp_pagenavi()?>
</div>
<div class="alignright">
<?php next_posts_link('|     &raquo; Previous Cartoon') ?>
</div>

Ugh! Is that right now? Or should this site not be called 'Vexentricity' (i.e. vexation + eccentricity) but rather 'The Beginnings of Dementia' ... ?

|



Oblivion? I’m oblivious to all else!



May 10th, 2006


Elder Scrolls IV: Oblivion for PCI’ve been playing the latest Elder Scrolls game Oblivion for the past few days.  Yes I know the weekend was 3 days ago and I’m supposed to be working now, but it’s just that it’s a hard game to stop thinking about. 

One of my kids called it ‘Oblivious’ and the name’s rather stuck because I must admit I am pretty much oblivious to everything else right now.  I’m just not bothered about  work, or that I have chapters due next week, or event blogging for that matter.  I was barely that excited when a box got delivered this morning containing a whole bunch of copies of  my new book Building Forums with vBulletin … and let’s face it normally I’d be signing a copy for the FedEx guy!  (But … and I  have to add this before my editor comes over and confiscates my Oblivion disks …  it is a really good book for newbie vBulletin webmasters, and you really should go buy it!)

I was new to Oblivion (until I learned of it from Dan Ackerman back when he linked to the history of the scrolls video) so I have no clue whether the previous 3 versions of the game were this cool to play … but I’ve got to say that I am really impressed.  I love the first person nature of the game and it is such a beautiful and totally immersive experience that it can be pretty hard to let go of. Yesterday I was walking down the street (real world, not virtual) and finding myself glancing at flowers in people’s hedges and wondering if they have healing properties or cure fatigue. Then I realized I was peering into people’s faces as they went past to see if they wanted to talk to me.  I even find myself swaying from side to side when I’m talking to people now and I keep expecting a little red hand to appear in front of items in the supermarket. 

Help me!  Just like the crew of Red Dwarf I’m trapped in a game and I suspect it might be better than life! Well, better than work anyway…

Building Forums with vBulletin

Building Forums with vBulletin is available from Amazon.com | Amazon.co.uk | Barnes & Noble and all good bookshops.

More info about the book will appear in Kingsley-Hughes.com’s books section  … once I’ve completed the Oblivion quest where I catch the gang who stole Gogan’s pants!



Manually Adding Feedburner to your WordPress Blog



May 4th, 2006


Feedburner is very easy to set up on your site if you use the WordPress FeedBurner Plugin.

If you plan to use this you must use the WordPress permalinks structure, which is all well and good if you've just started a new blog and can switch to that structure without affecting any existing posts on your blog. But if your site's been running for a while before you decide to add Feedburner, switching to that link structure isn't an option for you. Here are the changes you need to make to your blog's templates in order to add Feedburner without using the plugin:

  1. Login to your blog and click on Presentation, then Theme Editor.

    If you're new to editing your blog's theme, check whether it says "If this file were writable you could edit it" towards the bottom of the page and, if so, follow these instructions to set the permission on your theme's folder using your FTP program or cPanel File Manager.

  2. Choose the Header template.
  3. Within the template, find the following line of code and select the text:

    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

  4. Replace the text with the following line of code:

    <link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/your_feed_goes_here" />

  5. Now to add your Feedburner details. Login to Feedburner and follow the steps to add your feed. Then copy the feedburner address for your feed.

  6. Lastly paste the URL into the code and save your header template.

Now your Feedburner feed will be automatically discoverable by most RSS reader software and some browsers.

  1. Next, you need to add a Feedburner link in place of the existing one. You'll find this in the Footer template if you're using the Default WordPress theme or in the sidebar template if you're using the Classic WordPress theme.


    Default

  2. Classic

  3. Open the appropriate template in the theme editor and find the following code:

    feed:<?php bloginfo('rss2_url'); ?>

  4. Paste in your Feedburner link:

    Save the file by clicking Update File.

You can leave the comments feed as is (this enables readers to keep up with replies to your blog posts) or you could create a separate Feedburner feed for comments too. Of course if you don't have comments switched on you can delete the link altogether.

Another good way to provide a link to Feedburner is using a 'chicklet' Feedburner will help you to choose which chicklets you want and supplies the code to go into your template.

Happy Feedburning!



Smart Quotes in WordPress



May 1st, 2006


If you've ever posted code into a WordPress blog you may have noticed that single quotes (') get changed to smart quotes ().

One solution for preventing this is to remove the filters that are reformatting the text you enter. Download the plug-in fix to prevent smart quotes. (This is basically Katja's hack put into plugin form. I expect someone else has saved this as a plug-in somewhere, but I haven't found it myself as yet and this site is as much a repository for things I need to remember as for others to use! So apologies for any duplication... )

  1. Unzip the file "smart-quote-fix.php" into the wp-content/plugins folder.
  2. Log into WordPress site admin and click on the Plugins tab. Activate the plug-in from the list.


WordPress Error – Related Posts



May 1st, 2006


WordPress database error: [Can't find FULLTEXT index matching the column list]
SELECT ID, post_title, post_content,MATCH (post_name, post_content) AGAINST ('test page') AS score FROM wordpress_posts WHERE MATCH (post_name, post_content) AGAINST ('test page') AND post_date <= '2006-05-01 20:42:17' AND (post_status = 'publish' && ID != '1') AND post_password ='' ORDER BY score DESC LIMIT 5

If you have installed the WP Related Posts plugin for WordPress and you are getting the above error message then you need to carry out a quick database modification:

Modifying the database is simple. 
Open your database in phpMyAdmin (available in your cPanel as a rule)
Click on your database and click the SQL option.
Run the following SQL command (cut and paste it for simplicity):


ALTER TABLE 'wp_posts' ADD FULLTEXT 'post_related' (
'post_name' ,
'post_content'
)

http://wasabi.pbwiki.com/



Run IE7 without installing it



April 29th, 2006


If you're like me you're probably itching to start using the Internet Explorer 7 beta, but putting it on your main computer is a big risk and everyone knows that despite Microsoft's best intentions there are bound to be bugs and security loopholes in it ... so let some other sucker find them out the hard way first. But now you canrun IE7 without installing it. Excellent!

I've only tried it in a VMWare environment so far (which is where I already test IE7 anyway so I don't really need this hack) but do take care if you're trying this out for yourself.



Amazon This is the page you made – Oh no it isn’t!



April 28th, 2006


Amazon’s ‘This Is The Page You Made’ page used to be a really handy feature for suggesting items that I might like, based on previous purchases and items I’ve looked at recently.  But the last few days has changed all that because the only things Amazon.co.uk suggests I might like are pornographic art books or homosexual erotica!

I’m beginning to wonder if, based upon all the geeky gadgets and tech books I’ve bought from Amazon over the years, they haven’t discovered something deep down inside me that I’ve yet to discover about myself.  Nah!

Seriously though, this new bent certainly changes Amazon’s family-friendly image.  Of course there’s always been erotica and sex manuals on the site (and why shouldn't there be!) but it’s not something Amazon offers you unless that’s what you’re searching for (well except for that  time they sent me the Karma Sutra instead of the XML book I’d ordered, that is).

I wondered if it was maybe a temporary glitch or if something in my recently viewed items history was producing this (although I couldn’t imagine what it might be!) so I tried messing around with the Page you Made settings by deleting my previously viewed items. 

 20060428b[1]

The ‘page I made’ now tells me this:

          
And then it got a whole lot worse! When I view the Amazon front page or any page it now offers me a whole load more of what I've dubbed Ama-porn!


So does this mean that showing erotica on the front page is Amazon.co.uk's default setting when no information is available about the user? Has some cheeky monkey at got into the controls somewhere??

Someone suggested that maybe it’s because Brokeback Mountain is the featured movie on [tag]Amazon[/tag] UK right now, and it’s skewing everything else that’s offered up to site visitors. 

Hmmmm … I haven’t seen the film but it all sounds a bit ‘brokeback’ to me!


Buy Dilbert: Don't Stand Where the Comet Is Assumed to Strike...
Buy from Amazon.com
| Amazon.co.uk



Phone, Lipstick, Keys … Web Server!



April 25th, 2006


 Kingston Data USB Key - 2 Gigs!!   Here’s a great little tool that we’ve been using for a few weeks now and it’s made such a difference.  The Web Server on a stick is just that … a complete Apache webserver with PHP & MySQL running off a USB memory stick.  I’ve found it so useful that I rarely go anywhere without it now.  I run the server locally from harddisk and then synchronize it to my key (using Second Copy.  I carry a lot of USB keys so this program is especially handy as it identifies the USB key that I’m using and only copies to that key and no other.)
WOS - Web Server

When I’m away from my desk it means that I can carry with me the installations that I need WordPress, Gallery, VBulletin.  (Haven’t got Movable Type to run yet … but I’ll crack the darn thing yet!)  I don’t have to test out changes on live websites and I don’t have to rely on the remote servers and test sites.  It has really increased my productivity and I’ve got to say it’s a product that I’d happily pay for … but WOS Portable is free!

Update: Got an uncharacteristic attack of conscience after writing and decided I really did want to pay for it so much so that I upgraded WOS to the WOS-X version, not so much because I wanted the higher version, but because wanted to give the developer something for such great software.  Now I wish I’d hit ‘Donate now’ instead as the upgrade didn’t work and it took out my previous WOS installation along with it.  Probably my fault as some of the dialog boxes are in German (and don’t ya know I only took French in school).  Luckily I still have a backup of WOS as I have it installed on my hard disk as well as my USB key.  Not sure if I’ll be installing WOS-X again as I don’t really need the additional functionality and WOS on its own runs just fine!

Update II:  Here’s a great link on how to install WordPress onto WOS.



Widgets



April 25th, 2006


I've just installed the widgets plug-in for WordPress and so far I'm very pleased with what I see.  It certainly makes it easy to customize the website sidebar and there's pleasant additions like Recent Posts (which before now I've always added manually (with <?php get_archives('postbypost', '10', 'other', '<li class="prev_posts">', ' </li>', false); ?>).  I'm looking forward to seeing how it works out in template development ...

 Widgets Screenshot



%d bloggers like this: