Post-to-Post Links II Now at WordPress.org
Post-to-Post Links II is a plugin for creating links to other posts, pages, tags, or categories on your WordPress site, and it’s now available for download at wordpress.org. I also created Post to Post Links II error: No post found with slug "post-to-post-links-wordpress-plugin".
There are a couple improvements with this version:
- Now you can use it with tag slugs and tag IDs too
- Fixed a bug with using category slugs
As explained in the readme file, it unfortunately can’t interpret the tags from Scott Reilly’s old “Easy Post-to-Post Links” plugin. I used his plugin heavily, and if you want to convert your old tags for use with my new plugin, you can. Doing so requires 1. you to be comfortable running a SQL query and 2. that you consistently used only post slugs or only IDs with Scott’s plugin. If you used IDs in some tags and slugs in others, then you can’t make the conversion (as there’s nothing in the syntax of Scott’s tag itself that indicates whether you’re linking by ID or slug).
These are the steps:
- Make a backup of your WordPress database, or at least the wp_posts table. This is very important, in case you make a mistake in the SQL.
- Run this SQL statement if you always used slugs for your links:
update wp_posts set post_content = replace(post_content,'[post=','[p2p type="slug" value=');
Or run this SQL statement if you always used IDs for your links:
update wp_posts set post_content = replace(post_content,'[post=','[p2p type="id" value=');
I use the “text” attribute the same way Scott did, so that portion of the tag will carry over seamlessly in the conversion.