WP HELP NEEDED: Auto 301 redirecting deleted posts?

by 10 replies
13
Hello,



I have a site which has a lot of syndicated content (as well as a lot of original content, of course), but I'm overhauling it and intend on deleting a lot of these posts in favour of new, 100% unique, original content. However, I'd like to retain the backlinks these soon-to-be-deleted posts received, and channel them (along with any "link-juice" / PageRank) to the homepage.

I'm aware of the "Redirection" Wordpress plugin, but this only sets up 301 redirects for posts whose URLs/permalinks have changed - not those that have been deleted. I know I could manually set up these redirects as I delete the posts, but with hundreds (if not thousands) of them, that'd be a bit of a headache.

Does anyone have any advice or tips/tricks they'd use in this case?

(And for the record, I cannot redirect whole categories or anything like that, since my site's permalink structure doesn't use category names in the URLs - and there are some unique, original posts among them, which I want to leave alone.)
#programming #301 #auto #deleted #needed #posts #redirecting
  • I am just thinking outloud here so someone else might provide a better solution.

    I was wondering if you could setup a custom 404 page that redirects to the homepage. That way all the "not found" pages (deleted posts) would be caught and then redirected.

    But honestly, I have no idea how that works in terms of passing on link juice.
    • [1] reply

    • Thanks for the suggestion, marigot. I have considered this, but unfortunately there's no way to use a 301 and 404 together at the same URL, and removing the 404 error codes from my site completely may have negative consequences.

      The only other way is to retain the 404 and use a HTML-based redirect, but this wouldn't channel the link-juice like a 301 redirect would.

      What I'll probably end up doing is trying to establish (using Webmaster Tools) exactly which pages have backlinks and which don't. I'll make a "short-list" of the ones that have, and manually set up redirects for them, whilst removing and forgetting about the ones which don't have any backlinks at all.

      Not sure how infallible this approach will be, though, as I even don't think Webmaster Tools shows every backlink it knows about, so I'm bound to lose some in the process.

      I think this is going to be a "put off until another day" sort of job, LOL.

      EDIT: Actually, what I may do, alternatively, is keep all that content up, but just "hide it" away, by removing the category links from the sidebar. Then I'll set up new categories for the new content, and populate them with those old posts which are unique/original, so they can still easily be found by those surfing around my site.
  • Actually I personally would not use the backlinks found in Webmaster Tools. I find that most of my backlinks that I know are out there are not even shown in my account.

    About your "edit", even if you remove the category link to hide those pages, since they are already indexed, they are going to be available to the public. Using the "private" tag on the post instead of public would in fact hide them, but again, it doesn't help you to send the link juice elsewhere.

    I am sure someone will come along with an excellent suggestion. This seems to be a common issue for people redesigning their sites and I think many people use the mod_rewrite to accomplish this. I would help you with that but I can't start from scratch. I can only use examples I see in tutorials and make them fit my purpose.
    • [ 1 ] Thanks
  • Did you find an answer yet? I have the same problem.
  • Hah, what a coincidence ... it was just today, after a long hiatus from working on the site mentioned in the OP, that I got to thinking about this issue again.

    Unfortunately, though, no; I haven't yet found a simple and viable solution to this. Sorry! :p
  • How is WP supposed to know the difference between a post you've deleted and one that just doesn't exist and never has?

    You can easily redirect all 'not found' posts if you want to, but I think you're tilting at windmills - the Big G isn't going to heap "link juice" on your index page just because of a bunch of 301s.
  • There are various ways to handle this...

    .htaccess could be your friend here.

    you could set up a redirector to a simple 404 handler that is called on all failed page requests and output a pretty message,

    or in for example php you could...

    and add this to your 404errorhandler file, using this approach means the redirect sends a 301 - IIRC.

    to redirect all traffic to the index page.
    • [ 1 ] Thanks
    • [1] reply
    • Have to be a little careful with PHP header - default behavior on redirects is to send 302, you have to specify 301:
      • [1] reply
  • Banned
    [DELETED]

Next Topics on Trending Feed