• Hello,

    I have a huge amount of pages on my wordpress websites that I want to move to the “Articles” section. I’m talking about ~1500 pages that have to be moved.

    How can I do ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can write a database query which will do this for you. With your webhosting do you have access to an application called phpMyAdmin?
    Otherwise you need to run a PHP file which will modify the database like follows:
    UPDATE wordpress.wp_posts SET post_type = ‘page’ WHERE wp_posts.ID =1 LIMIT 1 ;

    Thread Starter jfoulquier

    (@jfoulquier)

    Yes I have access to phpMyAdmin.

    Thank you for your reply. But I assume you meant :
    UPDATE wordpress.wp_posts SET post_type = ‘article‘ WHERE wp_posts.post_type = ‘page’;

    I’m gonna try your suggestion. But are you sure it will be enough to work ? I mean, all my articles have rewrited url like https://www.mydomain.com/2009/09/keyword1-keyword2-id/
    How can my WordPress know the url of the articles that just have been moved from pages to articles ?

    Thx.

    ++

    Articles are known as posts in wordpress speak so it should actually be
    UPDATE wordpress.wp_posts SET post_type = 'posts' WHERE post_type = 'page';

    You have a point about the urls, do you have caching turned on? If not wordpress should adjust automatically, the urls aren’t stored in the database directly. Otherwise you may have to refresh the cache and flush the rewrite rules.

    Thread Starter jfoulquier

    (@jfoulquier)

    Thanks, it works well, just as expected.

    ++

    (sorry for the late reply)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to move pages to articles ?’ is closed to new replies.