Right now, feeds does not delete feed items when a feed node is deleted. Optionally, this should be possible.

Here are some challenges for this feature:

- Deleting feed items when deleting feed nodes only makes sense when a configuration is attached to a content type. This can be solved by hiding the option if the config is not attached.
- Will require a processor specific nodeapi() implementation. Right now we evade building nodeapi() infrastructure in FeedsImporter + FeedsPlugins for one exception with _feeds_nodeapi_node_processor(). An additional processor specific nodeapi function will be too much.


funkmasterjones’s picture

Version:» 6.x-1.x-dev

in feeds.module, feeds_nodeapi(), add a call to clear() before deleting source

case 'delete':
        // Remove feed from scheduler and delete source.
        feeds_scheduler()->remove($importer_id, 'import', $node->nid);
        feeds_source($importer_id, $node->nid)->clear();
        feeds_source($importer_id, $node->nid)->delete();

doesn't this accomplish what you want? The challenges you list above I don't quite understand them, are they no longer a problem with the newer feeds version?

this does however force deleting of all items without giving the user and option. This behavior may not be desired (although I can't imagine when), but it is really useful when building and testing feeds.

alex_b’s picture

I do think we should offer the site builder a choice on whether to delete the items imported from a feed (source) or not when deleting the feed node.

srobert72’s picture


jvieille’s picture

Any update on this? Deleting a feed often means we no longer wants news from it, so there must be an option to proceed with items deletion when deleting the feed.

yeeloon’s picture


Has this been fixed? I'm still encountering the feed items being imported, although the feed has been deleted for some time. Is there a solution to fix this?

alex_b’s picture

#5: this issue is about deleting feed items when a feed subscription is deleted, you are reporting sth different, care to open a new issue? I have a hunch that there may be even an existing one, please do a quick search - thanks!

Dane Powell’s picture

I'd love to see this implemented in some form - I'm spending a lot of time writing custom queries to clean up "zombie" feed items that get left behind when users delete parent feed nodes without deleting all of the child feed items first.

The way I envision it, feed items should always be deleted when the parent feed node is deleted. If someone just wants to stop importing new items, there should be an option to disable the feed without deleting it. But a feed item should never exist without a parent feed- that's like a comment existing without a parent node.

Just my humble opinion.

budda’s picture

Category:task» feature

I like Dane #7 idea that all feed items should ALWAYS have a feed node parent. Makes the logic easier to implement so that deleting a feed node deletes all its items.

twistor’s picture

Status:Active» Needs review
new2.07 KB

Needed this myself. The wording could probably use some work on the form item. I currently have the option disabled when the importer isn't bound to a node, but it's trivial to hide it as well.

Will White’s picture

new3.7 KB

Here's my latest patch from #954814: Automatically delete feed items when feed node is deleted.. This adds tests.

alex_b’s picture

Status:Needs review» Reviewed & tested by the community
new3.71 KB

Will's patch introduces delete items with node for data processor. This patch is RTBC as it includes a test.

Minor adjustments:

- Use feeds_batch_set() to delete items in anticipation of supporting this feature for the node processor.
- Remove debug output from tests.

Will commit shortly.

alex_b’s picture

Status:Reviewed & tested by the community» Needs work

#11 is committed now. Thank you.


#9 / twistor: This is what's needed to get the equivalent feature for node processor RTBC:

- Implement equivalent "delete_with_source" option in FeedsNodeProcessor (ie. copy code from #11 data processor to node).
- Add tests - this test should force batching by using tests/feeds/many_items.rss2

The nodeapi implementation should work for both processors.

twistor’s picture

Status:Needs work» Needs review
new4.18 KB

Check and check.

Laurent_’s picture

Hi Twistor,

Is there any reason for your (#13) to disable the delete checkbox in case of a standalone form ?



twistor’s picture

@Laurent_, In the case of the standalone form, there is no feed node to delete. The option could be hidden completely, if that's what you mean, but this makes more sense to me. I think though, that you mean for an option that deletes feed items when the importer is deleted, that would be a separate issue.

Dane Powell’s picture

Status:Needs review» Needs work

That patch will need to be re-rolled WRT the latest Git head

twistor’s picture

Status:Needs work» Needs review
new2.71 KB
Dane Powell’s picture

Status:Needs review» Reviewed & tested by the community

Cool, #17 seems to get the job done.

rashad612’s picture

Status:Reviewed & tested by the community» Patch (to be ported)

Is there any other solution to do this in Feeds 7.x-2.x ?

Mohammed J. Razem’s picture

Version:6.x-1.x-dev» 7.x-2.x-dev
Status:Patch (to be ported)» Needs review
new2.09 KB

Here's a port to 7.x-2.x

We need this in our project and would love to see this rolled out in alpha-5 release.

twistor’s picture

Status:Needs review» Needs work
Issue tags:+Needs tests

This needs a test to get in.