• I’ve dug around and haven’t seen an answer to this problem. I just imported years worth of Livejournal entries into a WordPress installation. I’m finding that entries that were private and friends only are appearing on the imported stuff, and I need to go through and delete them.

    But going into the post editor, I have to go in and edit each one, which is tedious.

    No idea if this is possible or not, but I think it’d be handy do do a THEME where you could see the entries, and put a delete button right on the entry itself. There’s some themes with an Edit button right there, so I’d think this might be doable?

    Rather than tweak the theme to do this, or tweak a plug in, it’d rock to have a very basic theme, making it easy to read and identify the various posts, with a one click delete button. Or, if a plug in is the answer, that’d be mighty cool too. Even if there was a checkbox somewhere in the Edit Posts area, you can already see the post’s subject line, but none of the post. It’s be sweet to have the first few lines of each post appear there too, so make identifying the content of posts made years earlier. Toss in a check box to go through and hit 20 at a time, and I’m sure others would make good use of it.

    Thanks- any ideas, feel free to shoot me an email at steven at hilltopdesign dot com.

Viewing 5 replies - 1 through 5 (of 5 total)
  • For a link like this, paste this code in the loop of your index.php:

    <?php if (current_user_can('edit_post', $post->ID)) echo "<a href='" . wp_nonce_url("/wp-admin/post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "'>Delete post</a>" ?>

    Thread Starter hilltopdesign

    (@hilltopdesign)

    Hmm… I can’t get it to work.

    Did you paste it in the loop of index.php? Because it probably won’t work in another file.

    Thread Starter hilltopdesign

    (@hilltopdesign)

    Sorry for the delay, my appendix decided I needed a break from this stuff for a while. 😉

    Ok, I added it to the index.php
    I used the default theme to try this out by the way.
    Adding this bit to the loop, or just under the beginning of the loop, added a delete post button at the top of the page, right under the header area. If there were two posts visible, as you’d see visiting the site, hitting the button would generate an error message. So I clicked a post, thinking it’ll work inside a single post being di
    splayed, but that didn’t work either.

    It was inserted just under this line:
    <?php if (have_posts()) : ?>

    Clicking it leads to this error:
    Not Found
    The requested URL /wp-admin/post.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    —————————————————-

    I just put everything back to where it was before, but this time, added that code just above the end of the loop:

    <?php endwhile; ?>

    This is getting closer, now it puts a delete post link underneath each post, and now, with the page showing the two test posts that I’ve made, shows two individual buttons. However, clicking them fires off the same error message as earlier.

    For what it’s worth, this is where it’s trying to go, which is where it’s tossing the error.
    http://www.hilltopdesign.com/wp-admin/post.php?action=delete&post=3&_wpnonce=1c4ad2d4cd

    Pasting that here, I just spotted the flaw. AHA!

    The code assumes the wordpress install is off the root of the main domain name, but actually, there’s two installs, one is in a directory http://hilltopdesign.com/findthepie/

    WordPress is installed inside the findthepie directory.
    I just went into the code and added /findthepie/ to the snippet, and viola, it works like a charm.

    It’s scary that I’m figuring this stuff out. 😉

    Now that I know how to get it to work, it’ll come in handy for my regular wp install. And going through this will remind me to check the path like this for other issues the come up.

    Now I can go and import 5 years worth of journal entries and start editing the things.

    Thanks a million for the snippet, this is nifty.

    Excellent tip….
    I had been wanting a one click delete function and this fit the bill perfectly.. Sure beats the 3 click going the edit link…

    Took me a couple of minutes getting the 404 not found to see that I had to put the / before the added directory name.

    Thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ability to delete posts via radio button’ is closed to new replies.