p2pConverter
p2pConverter (4.2 KiB, 3,431 hits)
Well, this is my very first Wordpress plugin that I have created. Let me tell you why I finally broke down and created one for myself.
You see, I am an administrator for the Secrets of the Universe and on that site are quite a few static pages. However (probably during an update or server recovery or something of the such) all of the static pages ended up as regular posts, and the permalinks broke. When this was finally discovered, I sought a solution to convert the posts back to pages easily. Well, after searching for such a plugin (I could only find one such called Post2Page yet it was broken, and I could not find any way to contact the author) I stumbled across a few websites that gave me some clues as to get this type of plugin to work. Anyways, that’s the story…I eventually learned how to put it together into a plugin, and here it is for your enjoyment!
This plugin has been updated with its own capability, p2pConverter, which is automatically applied to Administrators and Editors on activation. This capability can easily be modified to work with other roles via a Roles and Capabilities plugin. Also, Wordpress updated a hook for manage_page_columns in version 2.5, so Scompt’s extra plugins are not included in this version. If you are using a pre-2.5 version of Wordpress, please download one of the Archived plugins.
A couple more new features I would like to highlight are the fact that the Convert option works nicer when using the search bar to find specific posts. Also, you can now convert the post/page while you are editing it, automatically taking you to the edit screen for the new page/post. (I don’t know how many times I have started a post, only to realize that I meant for it to be a page or vice versa…this is very handy to have now!) Just look for the convert option in the bottom right side bar on the edit post/page screen.
Oh, and the newest version also includes a nice AJAX interface in the Manage section.
And this plugin has now been optimized for 2.7.
== p2pConverter==
Author: bbbco
Author URI: http://www.briandgoad.com/blog
Plugin URI: http://www.briandgoad.com/blog/p2pConverter
Tags: manage, edit, page, pages, admin, plugin, convert, post, posts, change, p2p
Requires at least: 2.5
Tested up to: 2.7.1
Stable tag: 0.8
== Description ==
Converts either a static Page into a Post, or a Post into a static Page! Depending on what type you want to convert, click on Posts or Pages. In the main table of all the Posts or Pages listed, you will see an extra column, with a Convert to Post! or Convert to Page! option. If you want to convert a Page or a Post to the either, click that button. Or you can click the Convert button while editing a Post or Page right next to the Delete and Publish buttons. A p2pConverter role capability prevents unwanted users from converting pages (i.e. only Administrators and Editors have this ability to begin with), which can be adjusted by using a Role Manager plugin.
== Installation ==
Copy the `p2pConverter` directory to your plugins directory and activate the p2pConverter
plugin from WordPress, and volia! You will now be able to convert!
== Frequently Asked Questions ==
None yet!
[Ask a question] mailto: bdgoad (at) gmail (dot) com
== Future Plans ==
* Incorporate bulk managemnet system per request (any advice in hooking into the new Bulk management system would be welcome!)
== Version History ==
= Version 0.8 =
* Layout adjustment for 2.7(.1)
* Minor tweaks
= Version 0.7 =
* AJAX-ified things.
* Script.aculo.us-ed the Manage section.
* OOP-ed the code
= Version 0.6 =
* Can convert post/page while in Edit Mode (located in bottom right side bar)
* Works nicer when using the search bar to find specific posts/pages
* Easier to mass manage
* Now includes own Role Capability, which automatically defaults to Administrators and Editors (can be adjusted using Role Manager plugin).
= Version 0.5 =
* As per request, Convert! option only available to roles with the ability to Delete Posts and/or Pages
* Included comments in my plugin
* Tab structured code
= Version 0.4 =
* Integrated title of Post/Page into prompt
= Version 0.3 =
* Integrated with default css
* Included prompt to ensure user accuracy
= Version 0.2 =
* Initial work on plugin
* Including scompt’s ManageCustomPages
= Version 0.1 =
* Idea / Concept formulation
= Download Now! =
*Version 0.8
p2pConverter (4.2 KiB, 3,431 hits)
February 21st, 2008 at 8:37 pm
Insalled your plug in – it works with the post, but have not options on the page convert. Any suggestions.
Thanks
February 24th, 2008 at 3:37 pm
This plugin uses scompt’s Manage Custom Pages script, which is included in the zip folder. Please ensure that the managepages.php and json.php files are included in the folder along with p2pconverter.php.
If this is the cases, there might be an issue with another plugin interfering with scompt’s ManageCustomPages plugin.
Brian
March 1st, 2008 at 9:19 am
Thanks Brian
This plugin was just the ticket. One of my sites was recently compromised and as part of the attack, all the pages were changed to posts, so this was a great way of changing them all back…
March 3rd, 2008 at 10:56 am
Cris B:
I am glad it helped you! Thanks for the feedback!
Brian
April 14th, 2008 at 12:23 pm
Hello,
I’ve installed this plugin last week and it’s really useful, thank you so much!
Adam
April 20th, 2008 at 9:30 am
thanks.. thats very cool plugin.
Thank you very much
April 26th, 2008 at 8:55 am
Thank you very much!
This plugin saved my life on a corrupted wordpress 2.1 installation at visible-orbit.org. I upgraded to 2.5.1 and then made use of your plugin to turn all the posts (that had mysteriously been converted from pages) back to pages again.
July 9th, 2008 at 5:25 am
[...] Version: 0.4 – License: GPL – Author: bbbco – Plugin Page – » Download [...]
July 12th, 2008 at 5:30 am
Awesome plugin!! Should have been a default feature within WP from the start to be honest.
Is it possible to add support for the Role Manager (v2.2.2) plugin so that you can allow only certain roles to be able to convert posts to pages and the other way round?
July 12th, 2008 at 1:43 pm
Steven,
Thanks for your comment. There are currently no plans to add support to integrate with Role Manager unless there is enough request and support for it. If you would like to modify the plugin to integrate like you would like with your website, you may do so as per the GPL license.
Thanks again for your feedback, and let me know if you do choose to modify the plugin!
July 17th, 2008 at 9:44 pm
p2pConverter…
This plugin allows you to easily convert a post to a page and vice versa through an easy to use interface. Just click on your Manage tab in Administration, and you will see a Convert option under….
July 28th, 2008 at 2:23 am
This is a cool plugin
July 29th, 2008 at 8:39 am
VERY COOL PLUGIN!!! This plugin works like a charm with 2.5, which saved me hours of time.
One recommendation: Have a batch conversion. You could add in the Page or Post Manage tab an option to convert all posts/pages that are selected. However, even without this feature it’s still relatively easy (unless of course you have hundreds of conversions, but it’s still easier than doing it by hand). THANK YOU. ~Paul
July 29th, 2008 at 4:30 pm
[...] p2pConverter [...]
July 29th, 2008 at 4:37 pm
[...] p2pConverter 0.6 [...]
July 29th, 2008 at 5:23 pm
[...] p2pConverter [...]
July 29th, 2008 at 5:24 pm
[...] p2pConverter [...]
July 29th, 2008 at 11:02 pm
[...] cool new WP plug-ins Found some cool new WP plug-ins – check ‘em out: Post and Page Exerpts Page to Post/Post to Page Converter Show or hide content from bots Internal Link building __________________ Making Coin – great [...]
July 30th, 2008 at 12:36 am
[...] p2pConverter [...]
July 30th, 2008 at 5:10 am
[...] Plugin Page [...]
July 30th, 2008 at 6:13 am
Bbbco,
Much thanks, great plugin! Been wondering if someone was going to be motivated enough to produce a version that worked! Summum Bonum
July 31st, 2008 at 10:26 am
[...] p2pConverter [...]
August 4th, 2008 at 1:58 am
[...] p2pConverter [...]
August 7th, 2008 at 1:08 pm
[...] p2pConverter 0.7 [...]
August 10th, 2008 at 4:06 pm
Hi! I have a question: When you convert a page to a post, are there any rewrite rules created as part of the process?
I have a page that has been linked to numerous times. I’d like to change it to a post, but I don’t want to mess up all of those links & bookmarks.
TIA! –Lisa
August 10th, 2008 at 5:06 pm
Lisa,
This plugin does not contain any rewrite rules other than the $wp_rewrite->flush_rules() function. However, after running some tests, it seems that Wordpress checks automatically to see if the reference is correct, and if not to redirect it to the correct closest matching URL. Example: If I had a page at http://www.briandgoad.com/blog/test and I converted it, the new URL would become http://www.briandgoad.com/2008/08/test. If I tried to access this page at the previous address, Wordpress would automatically forward me to the new URL. This works vice versa, regardless of whether you have converted a post/page or not.
Hope this helps!
Brian
August 10th, 2008 at 5:25 pm
Thanks for the info – I never even thought to check that!
It doesn’t seem to work, though, if you’re not using permalinks. My page address is http://www.lisaclarke.net/?page_id=43 but it comes up empty if I try to find http://www.lisaclarke.net/?p=43
I also tried to find a post that lives at http://www.lisaclarke.net/?p=667 by typing in http://www.lisaclarke.net/?page_id=667 and that also fails.
I might be able to rig up something in the .htaccess file. Thanks for the quick reply.
August 13th, 2008 at 11:03 am
[...] er forresten alle innlegg med oversatte innstikk blitt konvertert til sider. Innstikket p2pConverter kan brukes til den type konvertering om du ikke vil grave deg ned i databasen manuelt. « [...]
August 29th, 2008 at 10:37 am
[...] Page2Post (or Post2Page) Converter. It’s a simple plugin that converts your posts to pages or vice-versa. I know that I had a lot of pages that had built up over the years, and the original hierarchy had got lost. Not wanting to delete them, they were piling up in my ‘pages’ menu, simple answer: convert them to posts, they’re then archived! Alternatively, if you have a post that is a classic or a foundational type post: why not make it a page? You no longer have to copy and paste it. One click! Voila! [...]
September 16th, 2008 at 2:19 am
thanks, works great!
September 18th, 2008 at 5:17 am
Hi, I need a plugin like this!
I’ve given it a go, but as per my attempts to modify the database manually, I don’t get the ‘converted’ page to display correctly – only an image within the post is converted; the text is lost. And the url goes back to a id# rather than a friendly one.
It might be a permalinks issue? I’ve got the all-in-one-seo plugin (and the permalink redirect plugin) – I they that might affect it, but deactivating it doesn’t help??
Thanks,
September 18th, 2008 at 9:30 am
Mic,
You should not have to modify the database manually. You should only have to install this plugin, and it will take care of the database changes for you.
What version of WP are you using? I see that your permalinks are structured by category, but doing some tests on my Sandbox WP, that does not affect the plugin.
I do not exactly understand what you mean by saying that only an image is converted… After conversion, the page/post permalinks should remain in tact. Can you send me an email with more info?
October 10th, 2008 at 1:27 am
Thanks for the Great Plugin!
Cheers.
October 10th, 2008 at 1:38 am
[...] I was searching for some way to convert a Wordpress post (a blog entry) to a page (static content) without the need to edit individual database entries: ‘post_status’ column – from ‘publish’ to ’static’ etc when I came across p2pConverter [...]
October 26th, 2008 at 6:55 am
I’m a newbie to WordPress and created posts instead of pages – your plugin saved me hours of copying and pasting – thx very much
November 10th, 2008 at 11:11 am
Thanks!!! You just saved me a lot of time!
November 21st, 2008 at 12:26 am
I upgraded a friend’s blog from WP 2.1 to 2.7 and all the (dozens of) pages became posts for no good reason. This plugin has saved my hours of (unpaid) work- THANKS!
December 10th, 2008 at 6:15 am
This plug-in is really good
December 20th, 2008 at 2:45 pm
Nicely done! The integration into the interface is particularly slick.
A couple points relating to v2.7 (that may apply to earlier versions as well):
I notice that it leaves orphaned rows in wp_term_relationships for any categories associated with a post when converted to a page.
I have not checked, but it would be worth examining whether orphaned records are left in wp_postmeta (with meta_key = _wp_page_template) for a page template assigned to a page converted to a post.
December 20th, 2008 at 2:50 pm
One more note: the guid in wp_posts does not update to reflect the standard values that would be given. For example:
http://folmc/?p=178
should convert to:
http://folmc/?page_id=178
The original guid does properly redirect, though, so this does not appear to be a critical problem. I suspect that the difference between the two formats of guid is left over from earlier versions when pages and posts were more differentiated.
December 25th, 2008 at 6:54 pm
[...] P2P Converter: Convierte en un par de clics paginas en post y post en paginas, con este plugin no tendrás que hacer todo el trabajo cuando quieras convertir una pagina o un post. Más info y descarga [...]
December 27th, 2008 at 4:43 pm
[...] convertidor P2P (P2P converter) es ideal para convertir páginas en post o viceversa, sin tener que pasar por el [...]
January 13th, 2009 at 9:48 pm
[...] It’s the content that worries me. Yea – content. Why, we’ll it was my suggestion we used WordPress in setting up the site. Then I had another brilliant idea – enter all content into the site as pages, I hope that one doesn’t come back to haunt me. I only figured out a month later that pages in WordPress cannot be categorized. (Now, in perfect WP community fashion – there is a solution to this problem.) [...]
February 10th, 2009 at 10:55 pm
This worked absolutely fantastic! Saved me a lot of time.
February 19th, 2009 at 9:10 pm
what a great plugin! I did the same thing as the comment above mine. I have over 300 pages that I created for a website, and I may want to convert them to posts for design and category sake and also ease of changing themes. This will make the job tolerable! If I convert the pages over to posts, do I need to continue to keep the plugin active in the future for the redirects to continue to work?
February 24th, 2009 at 11:44 am
Just downloaded the zip file, the other required files
“This plugin uses scompt’s Manage Custom Pages script, which is included in the zip folder. Please ensure that the managepages.php and json.php files are included in the folder along with p2pconverter.php.”
are not included in the Zip as mentioned.
February 26th, 2009 at 6:33 pm
Those files are no longer needed, as Scompt’s Manage Custom Pages script has been integrated into Wordpress since version 2.5, thus they are no longer included in the most recent versions of p2pConverter.
February 28th, 2009 at 8:28 pm
Fantastic plugin – thank you very much for creating it! It saved me a bunch of time manually editing tables.
March 1st, 2009 at 1:55 am
What determines the category used when pages are converted into posts? I want to use a certain category.
Also — bulk convert! Finish this soon please! Heh.
March 1st, 2009 at 8:52 pm
The Pages that have been converted to a Post will attain the default category you have listed (i.e. whichever category cannot be deleted). (I will assume you have the latest version of WP, 2.7.0/.1 ) In order to easily modify which category your new posts use, you can check the ones you want to adjust in the Edit mode, and then from the Bulk options drop-down, select Edit. From the new drop-down menus that appear, you can select which category(ies) you want to place them in and hit Update Posts.
Hope this info helps! And I do intend to include bulk edit options soon! (However, there are not currently any good hooks to use for the bulk options, so I am a bit stuck)
Brian
March 2nd, 2009 at 12:12 am
[...] p2pConverter (0.8) [...]
March 2nd, 2009 at 11:23 am
The most useful plugin i have have used!!
had around 50 blogs with static pages that i wanted to change.
Thanx a lot
March 21st, 2009 at 9:45 am
Hi there,
Full credit to you – this is a really useful, well put together plug-in.
You really helped me out by creating this.
Thanks very much!
Si
March 22nd, 2009 at 5:20 am
This is a great idea. Does the plugin keep all existing comments with the converted page/post too? And is there an option to keep a copy of the original page/post too?
April 9th, 2009 at 8:51 pm
i freakin’ love you man.
April 15th, 2009 at 12:40 pm
Not that I’m totally impressed, but this is more than I expected for when I stumpled upon a link on Delicious telling that the info is quite decent. Thanks.
April 16th, 2009 at 12:52 am
hi thanks alot for this tool. one question though, i converted a post to a page but it still belong to a category (I can see it when i click the category it belonged to previously). pages shouldn’t have categories. how can i fix this?
thanks!
April 22nd, 2009 at 2:50 pm
Thanks! I had an error at install (from zip), fixed it by uninstalling and reinstalling your plugin (from wp). Posting the error to let you know reinstall worked.
Warning: in_array() [function.in-array]: Wrong datatype for second argument in \wp-admin\includes\plugin.php on line 268
April 28th, 2009 at 3:42 am
[...] searched the internet for an easier method and found this little plug-in called p2pConverter. This small plugin will place a button to convert your posts to pages and vice [...]
May 1st, 2009 at 1:12 am
Thanks, Brian. Another website is tidier, thanks to your efforts! One day I’ll get the hang of WP…
May 5th, 2009 at 1:35 pm
Brian,
Having trouble with this plugin and 2.7.1 and page slug. Usually the page slug appears below the title text field on the Edit page, but after conversion to a Page the slug isn’t there to edit. I DID notice that if you do a Quick Edit on the page, the slug IS there, but it’d be great for my users to be able to edit the slug where they usually edit it. Any thoughts?
May 5th, 2009 at 1:55 pm
Brian,
Two things:
1) Please disregard my last post… I didn’t have custom permalinks set up, so that’s why the slug wasn’t showing on the edit page. My bad.
2) Thanks for a really nice plugin. It does exactly what I needed done without any hassle. Great work!
May 5th, 2009 at 2:51 pm
Thanks so much! Thanks for posting your resolution as well for any other users that might be experiencing this and interested in a solution!
May 14th, 2009 at 6:49 am
So glad you wrote this so I don’t have to! My only wish is for a direct link that will work with wget. /download/1/ isn’t working
June 21st, 2009 at 12:06 pm
Thanks for making an awesome script.. it saved me a lot of trouble and headache for my site! Great work!
July 13th, 2009 at 4:51 pm
Very interesting. And it is working fine on WP 2.8.1 too.
July 21st, 2009 at 4:28 am
It works and for that thank you!
However when it converts the page to a post it does a 302 temporary redirect. Now Google does not look kindly on these types of redirects.
Is it possible to make some adjustments to the plugin so that it uses a search engine friendly 301 redirect?
Thanks
Danny
August 7th, 2009 at 2:45 am
Wonderful plug-in and just what I need. Thank you.
I do have near 1000 posts to convert though, so was wondering if there is an eta on the bulk application.
I appreciate you.
August 10th, 2009 at 3:09 am
Fantastic plugin! Love it.
September 4th, 2009 at 12:01 am
[...] this out : P2P converter! Saves [...]
October 2nd, 2009 at 3:13 pm
[...] WP issue: How to Put Posts in the Top Menu Bar You can use p2pConverter | Life of Brian [...]
October 15th, 2009 at 9:05 am
Hi -
Yahoo upgraded my version of Wordpress from 2.3 to 2.8 and all of my pages were converted into posts. Yahoo has not been helpful at all in terms of correcting the problem, although they admitted that it should not have happened. Their engineers are blaming it on my theme, but it happened to TWO of my sites, so I am skeptical.
I’m going to try your plug-in to see if I can fix the problem. 2 years of work! Yikes… I’ll check back in with some results.
October 15th, 2009 at 4:05 pm
The plug-in worked! Fantastic. Very simple. I just published each post (that used to be a page) into a page and the site amazingly figured it out. Like magic! Even the hyperlinks worked again. I am astounded.
Thanks so much. I will now move on to my new site and let you know how that progresses.
I will make a donation!
October 15th, 2009 at 10:14 pm
[...] to the genius of a generous wordpress coder, the site is back up and running after being down for just a few days. And he did it all for [...]
October 18th, 2009 at 1:23 am
Goopy,
Glad that the plugin was extremely helpful to you! I enjoy hearing great feedback from users about this simple plugin.
Brian
November 2nd, 2009 at 5:18 pm
Hi there!
You have a great app! Thank you so much for the efforts. I was just wondering (as others are) when you plan to incorporate a Bulk convert function? Is this in the works? If so, when will it be complete? Please let me know!
Thanks a lot!
Dan
November 6th, 2009 at 8:58 am
Thanks for writing this plugin. One suggestion that you could consider is to allow keeping the post/page after converting to page/post because in some situations it would be useful to have an entry as both a page and a post.
November 6th, 2009 at 2:02 pm
[...] p2pConverter [...]
November 7th, 2009 at 8:05 pm
Thanks for the plugin. Simple, and totally useful.
November 8th, 2009 at 2:04 am
Great plugin, but i need to convert all post to pages and import them to another site. Is there any way to convert all post to page without having to manualy config each post? Cause i got lots of post…….
November 8th, 2009 at 4:48 pm
never mind, i found this on the wp-forum and it works great to convert all posts:
Thanks guys, great idea. Here’s the sql I ran to convert posts to pages.
update wp_posts set post_type = ‘page’ WHERE post_type = ‘post’
the only thing that may* vary is if you used a different prefix on your table names, which would mean the table name may vary, slightly. wp_posts is the default, so wp_ may not be your prefix.
November 14th, 2009 at 8:10 am
Hi Brian, Thanks for a great plug-in that I used making my first WP blog (when I was wrestling with page vs posts for lots of articles).
Why doesn’t P2P show up in WP Plugin Search under “Add New” with an automatic install option? I’m doing a new blog now and it won’t show up. I’ve searched “P2P” “page to post” “P2P Converter” etc. Nothing.
Meanwhile, on my 2.8.6 blog I love that Convert to Page/Post button! Thank you!
November 14th, 2009 at 8:31 am
By the way…it is very easy to manually install P2P by manually copying it to the the PlugIns folder (I use FileZilla). But I’m still annoyed that WP’s built in search is not listing your very useful and functional plug-in.
November 27th, 2009 at 2:47 pm
Thanks for a very useful plug-in.
November 28th, 2009 at 8:13 pm
Thanks very much! Very useful plugin. Very nicely included in the editing page too.
Frank
January 7th, 2010 at 11:05 am
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off [...]
January 7th, 2010 at 1:44 pm
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off [...]
January 8th, 2010 at 8:31 am
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off when [...]
January 8th, 2010 at 4:32 pm
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off when [...]
January 9th, 2010 at 8:31 am
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off when [...]
January 11th, 2010 at 8:45 pm
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off [...]
January 27th, 2010 at 9:38 am
[...] on and off one by one to see if anything is adversely affecting load time. Some plugins like Page to Post converter don’t need to be enabled 100% of the time. Turn them on when you need them, turn them off when [...]
January 28th, 2010 at 10:55 pm
Thanks, man.
February 5th, 2010 at 11:01 am
[...] other changes. If you want to use the imported articles as pages and not posts, you’ll need Post to Page Converter Plugin. AKPC_IDS += "5048,"; Related posts:Squidoo Customer Service, Part II So I mentioned in my Squidoo [...]
February 5th, 2010 at 11:55 am
[...] If you order a lot of articles, and, like me, use wordpress as a CMS for your projects, here’s a tool to make migrating the posts in easier. Get the CSV2 Post plugin from Zack Preble. Use the article export feature from Textbroker to export your articles in batch. Then use the plugin to import in batch mode. I set the publish date in the import file to a future date, so nothing publishes as result of the import. I can then tweak the articles, add images, add tags, or make any other changes. If you want to use the imported articles as pages and not posts, you’ll need Post to Page Converter Plugin. [...]
February 5th, 2010 at 12:17 pm
[...] If you order a lot of articles, and, like me, use wordpress as a CMS for your projects, here’s a tool to make migrating the posts in easier. Get the CSV2 Post plugin from Zack Preble. Use the article export feature from Textbroker to export your articles in batch. Then use the plugin to import in batch mode. I set the publish date in the import file to a future date, so nothing publishes as result of the import. I can then tweak the articles, add images, add tags, or make any other changes. If you want to use the imported articles as pages and not posts, you’ll need Post to Page Converter Plugin. [...]
February 21st, 2010 at 3:35 pm
Thank you so much for great plugin.
This is mus for everyone.