It would be really nice to have feature that allows you to select a list of "orphaned aliases", restricted by node type, and to be able to bulk delete them. I have a very large database, with many orphaned aliases to test this on! All the other features are handy but don't lend themselves to finding orphans in bulk and then deleting them, though the Googlebot is quite helpful in regularly pointing them out.

Happy to clarify further, thanks

FC

Comments

starbow’s picture

Yeah, that would be useful.

projectspoint’s picture

OK How about this?

To do the tidy up in mysql, I have been using this:

// counts up the orphans //

SELECT COUNT(substring(`src`, 6)) AS src_nid FROM url_alias LEFT OUTER JOIN node ON substring(`src`, 6)=node.nid WHERE substring(`src`,1,5)='node/' AND node.nid IS NULL LIMIT 0,100;

// 3 queries

CREATE TEMPORARY TABLE url_alias_deletes AS ( SELECT pid FROM url_alias LEFT OUTER JOIN node ON substring(`src`, 6)=node.nid WHERE substring(`src`,1,5)='node/' AND node.nid IS NULL
);

DELETE t1 FROM url_alias AS t1, url_alias_deletes AS t2 WHERE t1.pid = t2.pid;

DROP TABLE url_alias_deletes;

As far as I can see, it works

Hope this helps ...

FC

starbow’s picture

Status: Active » Closed (fixed)