Delete all descendants

Gramps 5.1.6
Fedora 38

I want to delete a whole section in my family tree … how do I delete all descendants & families for a specific family.

First, is it really necessary to delete that branch? Are they hurting something or have dangerous data? The consensus has been to try to keep a single unified tree for your research. It minimizes rework since most trees have overlap.

You can do an export of the limited set anytime it is needed. Like… just before sharing the data with someone else.

Second, don’t do a mass deletion until 5.2 — particularly if you have more than a few dozen deletions. The 5.1.x does a view refresh after each deletion and it takes forever to delete a bunch of records. The 5.2 is smarter and does a mass delete incredibly quickly.

But here’s how you might approach deleting the descendants:

Create a custom filter for the descendants.

image

Apply it in the view and verify is has the correct set of people. You could select and delete all these people … but that would leave remnants behind: Events, sources, citations, notes, places, media - although emptied Families will clear away.

Which brings us to third: It is more cleaner to create a new tree with the people you DO want instead of eliminating the ones you DO NOT want.

Create an “Excluded” tag and use the Add/Remove Tag Tool addon tool to tag all those people.

Create rule to find all the People without an “Exclude” tag:
image

Now use that rule (with the ‘reference filter’ options) export to output everyone ELSE to a backup file.

Then import those into a fresh, new tree.

If you are sure of the records you want to delete and can create a filter for that branch…

Create the filter for the branch and then select the Return values that do not match the filter rules option.

Then create an Export of your database. Select the export to Gramps (XML) option and for the filters, set the People filter to this filter.

Once you have the file, create a new empty database and import the file. This should be your tree without the offending branch.

Left over will probably be the events, citations and notes, etc. of these people. Run the Remove Unused Objects tool. You may have to run it multiple times. A citation on an event does not become ‘unused’ until the unused event is deleted. And a note on a citation is still used until the citation is deleted. …

If a Place record shows as ‘unused’ I would keep it. The same for Sources.

Once this new database/tree is to your liking, you can then delete the old larger tree. (Or you may want to at least keep a backup of that tree.)

OK … that sounds good.
Never dealt with tags & filters before … so want to get it right.
After creating “Excluded” tag I should use the Add/Remove Tool to tag all those people … but there are over 1000 such persons in my family tree.
Is there a mass-tag?
Will that person’s family be tagged automatically?
And what about events, places and notes or should these be tagged manually?

The Add/Remove Tool is a 3rd-party tool specifically for mass changes to the tags of a type of object be use of a custom filter. The tag button in each Object Editor is used for changes to individual objects.

The Edit → Tag submenu is for adding and removing tags for a single selected object. But it can be used for an extended selection of objects too. However, it is easier to use the Edit → Tag → Organize Tags dialog to Remove a tag than it is to Remove the tag from all objects by selection or filtering. You can re-create the tag easily.

No. Tags for Families and for secondary objects are entirely independent.

If you export a set of tagged people (using the filtering method described above) only the People and secondary objects will be exported when you use the export’s Reference Filter : “Do not include records not linked to a selected person” option. So for the example of Places, if you have a Place hierarchy of a thousand places, only the Places (and the Enclosing Places of those) associated with the Events of the selected people will be exports. The other option takes along all the other objects except the filtered out people objects… Again for the example of Places, it would be all thousand places.

Thanks for clarification … most valueble.
I found that filter method is very powerful and I decided to use it.
What I did was to create 2 filters ’

Descendant of ‘person’ not more than ‘N’ generations away
Spouses of ‘filter’ match

It worked OK but the spouse to ‘person’ in the first filter is not included but all the other spouses are.
How can I get the first person’s spouse also included?

To apply a TAG to a large number can be easily done in the people view.
Use the filters you have created so only the people you want are displayed in the view. Hilight all in the view (Ctrl+A) and then select the tag you want from the Tag menu icon on the tool bar.

I want to extract different subsets from my family tree to create a new tree where all merged subsets are.
I made a filter ‘My Filter’ with a rule and tagged these people by using ‘My Filter’ in People/Find.
Then I removed the rule and created a new rule in ‘My Filter’ and tagged all people after a new find.
So far so good … but how do I export all tagged people?
In the Export Option there is no place where I can specify the tag.
What I did was to select all tagged people but Calculate Previews still gave me all people … not the tagged ones.
Where have I missed?
export

Create a new My tagged persons filter to search for people with the tag you used before as the result of My filter filter.

Then use it in the Person filter field of export dialog.

Note that if returned results for My tagged persons and My filter filters are the same, any of them is usable in the Person filter field (so in this case, there is no need of My tagged persons filter nor tag for people).

Thanks … it worked just fine … exactly what I wanted.
GRAMPS impresses me more and more … excellent software.
Also the level of knowledge in this forum is very high.

Glad you are enjoying it!

In many cases, it is the novice users’ first impressions that highlight an overly complex workflow. And that leads to developing simplifications… and improved documentation.

We (long-time users) will sometimes grow blind to the layers of paint of mis-matched hues.

That said, after asking for help, could you mark which response was the ‘Solution’ to your original question? If no single response was the answer, perhaps you could summarize and mark that?

Solution marking helps when searching the forum. If the search finds 10 results for “birth event not recognized” and one has a “solution”, it saves time.

Done … marked with Solution :slightly_smiling_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.