Weblog
04/28/05: Wordpress Permalinks for B2evolution Converts
One thing I failed to mention about my Wordpress conversion is the permalink behavior. This is important for anyone who uses trackbacks, or anyone who get search engine hits to particular posts. I noticed that Jeff had the same problem, so I've made a few modifications to the script I wrote to fix it for myself, and am now offering it here. B2evolution's permalink style replaces spaces and other special characters in post titles with underscores, making a permalink something like www.domain.com/2005/02/20/post_title_here. Wordpress, on the other hand, uses dashes, like www.domain.com/2005/02/20/post-title-here. This is what you end up with when you use the b2evo2wp.php script mentioned in the last post. Once I noticed this, I knew all my permalinks would be broken, so I made a quick script to change the existing permalinks back to match the b2evolution ones. This will not change future behavior, so any posts made after the conversion with be like "post-title-here" but we don't care since nobody is linking to those posts yet. This script is only meant to make the permalinks to existing posts consistent with any links pointing to those posts. Requirements: The original b2evolution tables (or at least the "posts" table) used to do the conversion must still exist. Instructions:
- Download the file here
- Unzip the permalink_fix.zip
- Open permalink_fix.php in a text editor and edit the config information. Note that you must enter all information for both the b2evolution and wordpress tables, even if this info is the same.
- Upload permalink_fix.php to your webserver
- Type the url to permalink_fix.php in your browser. If your mysql information is right, you will be informed of any titles that need to be edited manually (seems to be only those with single quotes in the title).
I will be submitting this script to the author of the b2evo2wp.php script for possible inclusion, but I will also keep it here for those that have already converted. Hope it helps :) [Edit] I should say that this was tested with b2evolution version 0.9.0.10 and Wordpress version 1.5. I cannot guarantee that it will work with other versions.