Y T Nuke  
Results 1 to 9 of 9
Hi there, I have a couple of TV series sites using WP, but want to ...
  1. #1
    Dodge's Avatar
    Dodge is offline Regular Member
    Join Date
    Jul 2009
    Location
    London
    Age
    21
    Posts
    339
    Reputation
    23
    Thanks
    97
    Thanked 39 Times in 28 Posts

    Default Easiest way to mass-edit all posts?

    Hi there,

    I have a couple of TV series sites using WP, but want to add in some kind of feature where users can report any problems with the video, which would then be emailed to me...

    Does any one have any idea how I could do this, and then easily add it to all my posts (there are too many to do manually), or if there is a plug in that would do this?

    Thank you!

  2. #2
    devoted is offline Registered Member
    Join Date
    Aug 2010
    Posts
    57
    Reputation
    13
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Default Re: Easiest way to mass-edit all posts?

    no need to edit all posts, but you will have to add some php code in ur template (single post).. just an idea sir g

  3. #3
    CyberSEO's Avatar
    CyberSEO is offline Regular Member
    Join Date
    Jul 2011
    Posts
    465
    Reputation
    33
    Thanks
    2
    Thanked 87 Times in 67 Posts

    Default Re: Easiest way to mass-edit all posts?

    That's very easy. Here is the script:

    Code:
    <?php
    // AddMe.php - the simple script that adds some given html code to every published post in the WP database
    // Put in into your WP root folder and simple run it once. e.g.: http://www.yourblog.com/addme.php
    // Don't forget to delete addme.php from your server when done! And do not run it twice!
    // Written by http://www.CyberSEO.net
    define ( 'TO_ADD', '<p>PUT HERE SOMETHING YOU WANT TO ADD</p>' );
    include ("wp-config.php");
    $wp_upload_dir = wp_upload_dir ();
    $query = "SELECT ID, post_content, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'";
    $posts = $wpdb->get_results ( $query );
    echo 'Addding. Please wait...<br />';
    foreach ( $posts as $post ) {
        $post->post_content .= TO_ADD;
        $post->post_excerpt .= TO_ADD;
        wp_update_post ( $post );
    }
    echo 'Done!<br />';
    echo 'Don\'t forget to delete addme.php from your server!';
    ?>
    Last edited by CyberSEO; 08-09-2011 at 10:56 AM.

  4. The Following User Says Thank You to CyberSEO For This Useful Post:

    Dodge (08-09-2011)

  5. #4
    Dodge's Avatar
    Dodge is offline Regular Member
    Join Date
    Jul 2009
    Location
    London
    Age
    21
    Posts
    339
    Reputation
    23
    Thanks
    97
    Thanked 39 Times in 28 Posts

    Default Re: Easiest way to mass-edit all posts?

    Quote Originally Posted by CyberSEO View Post
    That's very easy. Here is the script:

    Code:
    <?php
    // AddMe.php - simple script that adds a given html code to every published post in the WP database
    // Put in into your WP root folder and simple run it once. e.g.: http://www.yourblog.com/addme.php
    // Don't forget to delete addme.php from your server when done! And do not run it twice!
    // Written by http://www.CyberSEO.net
    define ( 'TO_ADD', '<p>PUT HERE SOMETHING YOU WANT TO ADD</p>' );
    include ("wp-config.php");
    $wp_upload_dir = wp_upload_dir ();
    $query = "SELECT ID, post_content, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'";
    $posts = $wpdb->get_results ( $query );
    echo 'Addding. Please wait...<br />';
    foreach ( $posts as $post ) {
        $post->post_content .= TO_ADD;
        $post->post_excerpt .= TO_ADD;
        wp_update_post ( $post );
    }
    echo 'Done!<br />';
    echo 'Don\'t forget to delete addme.php from your server!';
    ?>
    Perfect, thank you! So then I'd just need to enter some HTML code that will allow the email submit?

  6. #5
    mickeylove's Avatar
    mickeylove is offline Newbies
    Join Date
    Jul 2011
    Posts
    55
    Reputation
    10
    Thanks
    12
    Thanked 2 Times in 2 Posts

    Default Re: Easiest way to mass-edit all posts?

    Not sure if this helps, but I did something similar last night, with help in this thread

    /blogging/339548-adding-affiliate-ads-wordpress-site.html

  7. #6
    CyberSEO's Avatar
    CyberSEO is offline Regular Member
    Join Date
    Jul 2011
    Posts
    465
    Reputation
    33
    Thanks
    2
    Thanked 87 Times in 67 Posts

    Default Re: Easiest way to mass-edit all posts?

    Yes, you have to put it here:

    define ( 'TO_ADD', '<p>PUT HERE SOMETHING YOU WANT TO ADD</p>' );

    Then simple save the script as addme.php, upload it to your WP root folder and run it once, e.g.: http://www.yourblog.com/addme.php

    Remove the script from server when done!

  8. #7
    Dodge's Avatar
    Dodge is offline Regular Member
    Join Date
    Jul 2009
    Location
    London
    Age
    21
    Posts
    339
    Reputation
    23
    Thanks
    97
    Thanked 39 Times in 28 Posts

    Default Re: Easiest way to mass-edit all posts?

    Quote Originally Posted by CyberSEO View Post
    Yes, you have to put it here:

    define ( 'TO_ADD', '<p>PUT HERE SOMETHING YOU WANT TO ADD</p>' );

    Then simple save the script as addme.php, upload it to your WP root folder and run it once, e.g.: http://www.yourblog.com/addme.php

    Remove the script from server when done!
    Thanks, really appreciate that! I don't know HTML but I think there are plenty of sites that can give me the code for this email submit thing anyway!

  9. #8
    iSynergy Media's Avatar
    iSynergy Media is offline www.isynergymedia.com
    Join Date
    Feb 2010
    Location
    Warrichpk@gmail.com
    Posts
    1,106
    Reputation
    24
    Thanks
    33
    Thanked 151 Times in 45 Posts

    Default Re: Easiest way to mass-edit all posts?

    I don't think you can mass edit all posts, you have to do that manually. But you can mass perform a single action on all of them.

  10. #9
    digibing is offline Junior Member
    Join Date
    Mar 2010
    Posts
    151
    Reputation
    19
    Thanks
    79
    Thanked 29 Times in 22 Posts

    Default Re: Easiest way to mass-edit all posts?

    As the previous guy said, just edit the template.

    But if you want to add something to all posts, try exporting the database in phpmyadmin as a text file. Use a good file editor to add your desired code at whatever marker signifies the beginning, or end, of a post. Then import the text file into the database again. Remember to backup before you attempt this though.

Natural Slow Link Building


SEO Blasts - High quality link building service

Similar Threads

  1. Replies: 2
    Last Post: 02-24-2009, 06:25 PM
  2. Replies: 0
    Last Post: 01-15-2009, 04:15 PM
  3. How long can I edit my posts?
    By gorgonite in forum BlackHat Lounge
    Replies: 1
    Last Post: 12-24-2008, 05:57 AM
  4. Why Can't I Edit My Posts?
    By ArtfulWebSites in forum Forum Suggestions & Feedback
    Replies: 2
    Last Post: 09-21-2007, 03:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  SEnukeX SEO Software
Proudly Powered by Hostwinds.com Web Hosting Click Here For Exclusive BHW Discounts!

Cheap Web Hosting


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76