# Delete all descendants

**URL:** <https://gramps.discourse.group/t/delete-all-descendants/4064>\
**Category:** Help\
**Created:** [August 24, 2023, 4:22pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064 "2023-08-24T16:22:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 24, 2023, 4:22pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/1 "2023-08-24T16:22:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [August 24, 2023, 5:06pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/2 "2023-08-24T17:06:04Z")

</div>

**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](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/3/309abd63c748f841680bd42c3235cafb4179f34f.png)

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](https://gramps-project.org/wiki/index.php/Addon:AddRemoveTagTool)** addon tool to tag all those people.

Create rule to find all the People without an “Exclude” tag:  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/5/54793b2580c5421aaaa7bb5c048198a8f69215c2.png)

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

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/6/6ee4e768bf7139f3dd16fa06da704606f16d8ede.png)

Then import those into a fresh, new tree.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [August 24, 2023, 8:29pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/3 "2023-08-24T20:29:55Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 25, 2023, 1:27pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/4 "2023-08-25T13:27:01Z")

</div>

> [@emyoulation](#):
>
> **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.

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?

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [August 25, 2023, 3:13pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/5 "2023-08-25T15:13:01Z")

</div>

> [@rajan](#):
>
> 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?

The [Add/Remove Tool](https://gramps-project.org/wiki/index.php/Addon:AddRemoveTagTool) 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.

> [@rajan](#):
>
> Will that person’s family be tagged automatically?

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

> [@rajan](#):
>
> And what about events, places and notes or should these be tagged manually?

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.

---

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 25, 2023, 6:33pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/6 "2023-08-25T18:33:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Davesellers](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesellers/32/1457_2.png) [@Davesellers](https://gramps.discourse.group/u/Davesellers)\
**Post date:** [August 25, 2023, 8:19pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/7 "2023-08-25T20:19:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 28, 2023, 11:18am UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/8 "2023-08-28T11:18:54Z")

</div>

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](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/e/e1452629e437cc0566de5244ca24e49ae70229cc.png)

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [August 28, 2023, 11:33am UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/9 "2023-08-28T11:33:25Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 29, 2023, 11:23am UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/10 "2023-08-29T11:23:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [August 29, 2023, 12:59pm UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/11 "2023-08-29T12:59:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rajan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/rajan/32/5420_2.png) [@rajan](https://gramps.discourse.group/u/rajan)\
**Post date:** [August 30, 2023, 9:34am UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/12 "2023-08-30T09:34:05Z")

</div>

Done … marked with Solution 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [September 29, 2023, 9:34am UTC](https://gramps.discourse.group/t/delete-all-descendants/4064/13 "2023-09-29T09:34:40Z")

</div>

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