HOW TO
In ArcGIS Pro, an empty feature class is a feature class that exists but contains no feature records. These empty feature classes can be deleted using ArcPy to improve data maintenance and ensure a well-organized geodatabase structure. This article demonstrates the workflow to delete the two empty feature classes, Buildings and Routes, as found in the Catalog pane below, using ArcPy.

Note: This workflow requires a full script to run in the ArcGIS Pro Python window. The indents must be retained as portrayed in the code block.
import arcpy
gdb = r"<gdbFolderPath>"
arcpy.env.workspace = gdb
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.activeMap
for fc_name in arcpy.ListFeatureClasses():
if int(arcpy.management.GetCount(fc_name)[0]) == 0:
for lyr in m.listLayers():
if lyr.name == fc_name:
m.removeLayer(lyr)
print(f"Removed from map: {fc_name}")
arcpy.management.Delete(fc_name)
print(f"Deleted from geodatabase: {fc_name}")
The code block below demonstrates the full working script for multiple empty feature classes.
import arcpy
gdb = r"<gdbFolderPath>"
arcpy.env.workspace = gdb
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.activeMap
for fc in arcpy.ListFeatureClasses():
if int(arcpy.management.GetCount(fc)[0]) == 0:
for lyr in m.listLayers():
if lyr.name == fc:
m.removeLayer(lyr)
print(f"Removed from map: {fc}")
arcpy.management.Delete(fc)
print(f"Deleted from geodatabase: {fc}")
Below is the updated Catalog pane after the empty feature classes are deleted.

Article ID: 000042574
Get help from ArcGIS experts
Start chatting now