• I migrated from Blogger to WordPress. I managed to fix about 50% of my blogger post urls so they now redirect to WordPress. But I was told to upload the following php script to a wordpress folder to fix the rest. The problem is, I can’t find a folder or would it be a plugin folder? If it is a plugin then what type of plugin?
    ………………………………………………………………………………………………..
    Here is the code and instructions.

    At this point you can use the following php script. Just copy-paste following codes into a file with name like fix.php and save/upload it to the WordPress folder. Then just open its URL from the browser. URL will be like: https://example.com/fix.php (replace example.com with your domain name).

    <?php
    require_once(‘wp-load.php’);
    $res = $wpdb->get_results(“SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = ‘blogger_permalink'”);
    $wpdb->print_error();
    foreach ($res as $row){
    $slug = explode(“/”,$row->meta_value);
    $slug = explode(“.”,$slug[3]);
    $wpdb->query(“UPDATE $wpdb->posts SET post_name ='” . $slug[0] . “‘ WHERE ID = $row->post_id”);
    $wpdb->print_error();
    }
    echo “DONE”;
    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The first line tells you that this script must be in the same folder wp-load.php is in.

    Thread Starter Mj Rod

    (@mj-rod)

    Well, there’s the rub! I asked the question because I don’t know where to locate said folder. But I just figured it out. The problem here is everyone ASSUMES. First I didn’t upload WP from the web and then unzip it. I uploaded it directly from my host company. So the host company has all the directories and folders. It there I need to upload the php script to. They have a folder called wp-load-php.

    Erm yes, files for your website are on your web host, regardless of where you got them from.

    Also, it’s a file named wp-load.php. A normal WordPress installation doesn’t have a wp-load-php folder. When you’re working with computers, these details matter.

    Thread Starter Mj Rod

    (@mj-rod)

    I’m new at all this. Remember I was using blogger. It is pretty much straight forward. I didn’t have a host. Well, maybe you can answer a follow up. I found the wp-loap.php. Is there a specific location within the file to add the code.

    In other words, when I’ve edited code in an html template for example, I would either add it just below the <head> or somewhere with in the </body>. I understand this is NOT the same but is there a place within the current code in wp-load.php folder I add this to?

    From the instructions you got,

    At this point you can use the following php script. Just copy-paste following codes into a file with name like fix.php and save/upload it to the WordPress folder. Then just open its URL from the browser. URL will be like: https://example.com/fix.php (replace example.com with your domain name).

    Create a new file and name it fix.php. Put that file into the same folder as the wp-load.php file. Do not edit the wp-load.php file at all.

    Note that I’m just helping you follow the instructions. You should backup the database before your run the script, just in case. You can do that by using a tool like phpmyadmin which should be provided by your web host.

    Thread Starter Mj Rod

    (@mj-rod)

    Thanks for you help. I appreciate it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to create a WP folder’ is closed to new replies.