WordPress plugins, themes, tips and hacks

Transferring Simple Tagging tags into another WordPress blog

Thursday, October 18th, 2007

I recently had to migrate an entire blog from one installation to another. WordPress does have an export function, and there are many database backup plugins and managers, but these really only work well with a basic installation that doesn’t use any plugins that created tables. So, in my case, I couldn’t find anything that enabled me to move the Simple Tagging tags from one blog to another - easily.

Why am I still using Simple Tagging, you may ask, if shiny new WordPress 2.3 has tags built-in?

The answer, my friends, is that most of my blogs are still running on 2.2.x, and that is because I try to install all my WordPress sites with Fantastico, and Fantastico has still not upgraded to 2.3. But once I’ve got my Simple Tagging tags in my new blog, they can be automatically integrated into 2.3’s tagging system once I upgrade.

I finally figured out how to move the whole blog, tags and all, using phpMyAdmin, so here are the directions in case anyone else may find they need them. These directions can be applied to migrating any plugin databases to an entirely new installation. Before you do any of this, backup ALL database files, and pray that nothing gets screwed up:

  1. Log in to phpMyAdmin for the old site. You can do this through your Control Panel, or I guess through complicated server commands. I’m a Control Panel gal myself.
  2. Click on the drop-down menu on the left and select the right database, or click on Databases in the main window, and then click on the database. You will now see a list of all the tables in this database.
  3. Click on the Export tab at the top of the page.
  4. There is an Export box at the top right-hand side of the main window. It lists all available tables in the database. Select the following by holding down Ctrl and clicking: wp_categories, wp_comments, wp_link2cat, wp_links, wp_post2cat, wp_post2tag (this is a Simple Tagging (ST) table), wp_postmeta, wp_posts, wp_stp_tags (ST table), wp_tags (ST table), wp_tag_synonyms (ST table), wp_usermet, wp_users. If you’re doing this for other plugin tables, just ignore the tables above that say (ST table) after them, and look for unique databases that are not in the list above (except wp_options - see below to find out why).
  5. Leave all the other options as they are, click on Save as file, leave the File name template as is, Compression can be None or zipped or gzipped - if your databases are really big, you might want to choose zip or gzipped so that the download (and later the upload), won’t take so long.
  6. Click Go.
  7. Save this file somewhere where you can find it easily.
  8. Now, go to the other database in phpMyAdmin. Depending on how your sites are set up, you may be able to access the database where you are right now, or you may need to login to phpMyAdmin somehwere else.
  9. Once you have clicked on the correct database, delete all the tables that have the same name as the ones listed above in step 4. The reason for this is that you are going to be importing the tables from the old blog, and when phpMyAdmin sees a file with the same name, it won’t import it and will skip it. In short, phpMyAdmin does not synchronize tables. To delete the files quickly, select each table you want to delete by checking the box on the left of it, and then scroll to the bottom of the list of tables to a drop-down box that says “With selected:”. Click on that, and select Drop. That will delete all the selected tables.
  10. Now, click Import. Under File to Import, browse to find the file you exported in Steps 4-6. Leave all the other settings, and press Go.

That’s it! Now hopefully your new blog works and has all the info from the old one. If it doesn’t, you’ll just restore all your backups and try again!

You may have noticed that we ignored a table in both blogs called wp_options. The reasons for this is that it seems that this file records the domain and URL for the blog. So if your old blog was at www.mydomain.com, and your new one is at www.yourdomain.com, the first domain will appear in the second blog. This can screw things up pretty royally in terms of folders and files for the blog. Believe me, I know. At one point I couldn’t even get into the Options page in the WordPress admin anymore.

I hope I didn’t miss anything in the steps, and I hope this helps!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

My favorite WordPress tip

Saturday, September 8th, 2007

Blogging Challenge - Lorelle on WordPressIn Lorelle’s latest blog challenge, she asks us to describe our favorite WordPress tip. She says to think back to when we started experimenting with WordPress, and try to remember what tips we found valuable.

I started WordPress Garage in order to document my discoveries about WordPress. It was meant to serve as an online manual of sorts. So I decided to go back in time to see what I was blogging about close to the beginning of my WordPress journey.

I can see that the issues that interested me most at that time were related to optimizing blogs for search engines and readers. Here are the tips that most interested me at that time:

  • Tags - Tags are useful for more detailed categorization of posts, search engine optimization, and user navigation. I wanted to find the perfect tagging plugin that not only would add tagging, but enable me to create tag clouds and list related posts based on those tags, so that I could use one plugin for three features. First I tried Jerome’s Keywords Plugin, only to find that it didn’t work once I upgraded from WordPress version 2.1.1 to 2.1.2. I then tried out Simple Tagging, which works wonderfully and does everything I want it to do, and now use it on all WordPress blogs and sites that I build.
  • Excerpts - if you use <?php the_excerpt() ?> instead of <?php the_content() ?> in your template files so that certain pages automatically display excerpts instead of the full text of the post, all html tags are stripped from the text. That means that if you have images or links in the first paragraph or so of text, they are removed from the excerpt. Annoying. I searched for a solution and found The Excerpt Reloaded plugin. Only, it didn’t work quite right - if my excerpt had a bulleted list in it, for example, the entire page following that excerpt would be styled as one long list. But Rob, a blessed plugin developer, created a mod of the plugin that fixed this problem. I highly recommend using this plugin if you want to automatically display excerpts and retain the formatting.
    Excerpts and videos: even with Rob’s plugin, videos that are embedded in the beginning of any post will not appear in excerpts - only the code will. So far, the only way that I have found for displaying videos in excerpts is to stop using <?php the_excerpt() ?> and to manually insert excerpts.
  • Future posting - this is a tip that I learned from Lorelle. When I first started blogging, I would write five posts on one day, and then publish nothing for the next couple of days. Not a very good strategy, since people, and maybe even search engines, like to see new content on a daily basis. So I started future posting whenever possible, which gave me some peace of mind for a few days where I knew I could take a break from blogging.

The above tips are pretty basic, but I think they can mean the difference between a well optimized and usable blog, and one that doesn’t reach its potential.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Jerome’s Keywords broke during upgrade, now using Simple Tagging

Saturday, March 24th, 2007

I was using Jerome’s Keywords for tagging posts, and all was working fine until I finally upgraded from 2.1.1 to 2.1.2 (yes, I know, I should have done it a long time ago, but upgrades scare me).

The upgrade went fine, but I noticed that when you clicked on a tag, it takes you to a 404 error page. I searched the web to find out what was going on, and it seems that Jerome’s Keywords has a bug that makes it problematic with WP 2.1. He’s released a beta of this plugin that is compatible with WP 2.1, but I definitely don’t want to work anything unstable after this tagging fiasco. Ultimate Tag Warrior is also not an option, since it seems that the tagging breaks if you approve a comment. Yikes.

Addendum: Since I wrote this post, Chris from Solo Technology wrote a comment saying that Ultimate Tag Warrior works fine with WP 2.1. This is good to know since there are a lot of plugins for WordPress that are based on Ultimate Tag Warrior and add extra functionality to your blog. In the meantime, I’m still using Simple Tagging.

I found the solution: the Simple Tagging plugin. This is a brilliant plugin that does more than just tag, and has many great features that Jerome’s Keywords does not. Once you’ve activated the plugin, it creates a new toolbar called Tags, under which you have a few options: Tag Options, Manage Tags, Not Tagged Articles, and Import Tags. There are so many options on these pages, such as batch changing, adding, or deleting tags, feed options, meta options, tag cloud options, identifying articles that haven’t been tagged, and importing tags from Jerome’s Keywords or the Ultimate Tag Warrior Plugins.

Features:

First of all, this plugin displays the tags you’ve already used in Write>Post so that you can easily select tags for a post. It also auto-completes for you if you start typing a tag. You can set it up to add tags to the meta data on a page, and have related posts based on tags appear. This removes the need for two separate plugins for meta data and related posts.

It has an import function for importing tags from Jerome’s Keywords which works smoothly, and you can create a tag cloud.

How I installed it and tweaks I needed to make:

First I imported my tags from Jerome’s Keywords. This went smoothly, but I was still getting 404 error pages when I clicked on a tag. I fixed this by going to Tags>Tag Options, and under General Options changing the Tag search base from “tag” to “keywords” and then back to “tag” again. For some reason, this resolved the issue.

Then I pasted the code for displaying the tags in my home, index, search and archive page templates. I also pasted the code for displaying related posts. This worked fine.

Finally, I pasted the code for the tag cloud in my sidebar. This didn’t work quite so well, and needed some tweaking. First of all, if you want to style your tag cloud, make sure to paste the following into your template page:

<?php if (class_exists('SimpleTagging')) : ?>
<ul id ="tagcloud"><?php STP_Tagcloud(); ?></ul><?php endif; ?>

Then, you need to add styles to your stylesheet. There is available CSS on the Tag Cloud page of the plugin, which I used, but it created a list of tags rather than a cloud. So first I went into the WordPress administration, and went to Tags>Tag Options, and under Tag Cloud I changed the “Cloud tag link format” to

<a class="t%scale%" title="%tagname% (%count%)" href="%fulltaglink%">%tagname%</a> so that it wouldn’t be based on <li>. Then I changed the CSS to the following:

ul#tagcloud { padding:0; margin:0; text-align:center; list-style:none; }
ul#tagcloud { display:inline; color:#FF6600; background: none; padding: 0;}
ul#tagcloud a, ul#tagcloud a:link { text-decoration:none; }
ul#tagcloud a:hover { text-decoration:underline; }
ul#tagcloud a.t1 { font-size: 80%; }
ul#tagcloud a.t2 { font-size: 110%; }
ul#tagcloud a.t3 { font-size: 150%; }
ul#tagcloud a.t4 { font-size: 180%; }
ul#tagcloud a.t5 { font-size: 200%; }
ul#tagcloud a.t6 { font-size: 220%; }
ul#tagcloud a.t7 { font-size: 250%; }
ul#tagcloud a.t8 { font-size: 280%; }
ul#tagcloud a.t9 { font-size: 310%; }
ul#tagcloud a.t10 { font-size: 330%; }

These styles did the following: it made sure the text was the same orange as on this blog; and I changed the percentages so that they were more in line with what looked ok to me. Finally, to center the whole thing, I went into my sidebar template and wrapped the whole thing in a centered div, so that the code there looked as follows:

<h2>Tags</h2>
<div align="center">
<?php if (class_exists('SimpleTagging')) : ?>
<ul id ="tagcloud">
<?php STP_Tagcloud(); ?>
</ul>
<?php endif; ?>

This is a really handy plugin, and I recommend checking it out.

Simple Tagging plugin>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Jerome’s Keywords Plugin

Wednesday, February 21st, 2007

“Jerome’s Keywords” is a plugin for WordPress 1.5.x and 2.0 and to associate keywords with your posts.

I used it for my tags on the right. To get them to look like a cloud, I used the following code:

<?php all_keywords('<strong><a href="/tag/%keylink%" style="font-size: %count%px" >%keyword%</a></strong>', '', 10, 30) ?>

Jerome’s Keywords Plugin>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Premium News Themes