Deleting HMI Tag Lists in TIA Portal: Step-by-Step Procedure

David Krause11 min read
SiemensTIA PortalTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

When working with TIA Portal for SIMATIC HMI configuration (WinCC Comfort/Advanced/Professional), engineers frequently accumulate multiple tag lists (also referred to as tag tables) during project development. Unlike program blocks (FBs, FCs, DBs), tag lists in the HMI part of the project are governed by a special rule: the project always contains one default tag table, and this default cannot be deleted from the project tree. Only user-created tag tables can be removed through the right-click context menu. This article documents the precise procedure for deleting HMI tag lists, explains the behavior of the default tag table when renamed, and provides a comparison with tag-database handling on competing HMI platforms (Rockwell FactoryTalk View, AutomationDirect C-More, AVEVA InTouch).

Engineering note: The terms "tag list," "tag table," and "tag group" are often used interchangeably in Siemens documentation. In TIA Portal V16 and later, the project-tree node is labeled "Show all tags" with sub-nodes for each tag table. The default table is created automatically when a new HMI device is added and is always present.

Prerequisites

  1. TIA Portal installation – V15.1, V16, V17, V18, V19, or V20 with the WinCC Comfort/Advanced/Professional option installed. The default-tag-table restriction applies to every TIA Portal version that ships HMI configuration.
  2. Project access – The HMI device project must be open in the project tree with write access. Open projects from read-only archives or protected libraries cannot be edited.
  3. HMI device added – At least one HMI device (Comfort Panel, WinCC Runtime Advanced, or WinCC Professional) must exist in the project. Tag tables are scoped per HMI device; the same name can exist under two different HMI devices.
  4. Local user rights – No additional rights beyond the standard TIA Portal project editor role are required. Admin rights are only necessary when the project resides in a multi-user server path.

Understanding the Default Tag Table

When a new HMI device is added to a TIA Portal project, the engineering framework automatically generates one tag table called Default tag table (German: Standard-Tagtabelle). This table is referenced internally by:

  • Screen objects using tags from the default scope.
  • HMI alarms that resolve symbolic names through the default table.
  • The OPC UA server of WinCC Runtime when no explicit tag-table assignment is configured.
  • Cross-reference and "go to usage" operations from the PLC program side.

The default tag table is project-bound and cannot be deleted. Attempting to right-click and select Delete on the default tag table produces no menu entry, or the menu entry is grayed out depending on TIA Portal version. This behavior is documented in the Siemens TIA Portal Help system under the topic HMI tag tables > Working with tag tables.

What Happens When You Rename the Default Tag Table

The default tag table can be renamed (for example, to ProjectTags or Motor_IO). However, renaming does not change its internal property as the default container. The property flag "Default tag table" is bound to the original instantiation, not the user-visible name. Engineers who rename the default table frequently report that they cannot delete it – this is expected behavior. After a rename, the table still cannot be deleted because the property is name-independent.

Step-by-Step: Deleting a User-Created HMI Tag Table

Use the following procedure to remove a tag table that was created manually (anything other than the original Default tag table):

  1. Open the project tree in TIA Portal and navigate to your HMI device, for example HMI_1 [KP1200 Comfort].
  2. Expand the HMI tags node. The default tag table appears at the top, followed by any user-created tag tables.
  3. Identify the target table. User-created tables are usually named descriptively (Motors, Valves, Sensors, Recipe_Data). The original default is named Default tag table unless it was renamed.
  4. Resolve tag usage before deletion. Select the tag table and press F11 or right-click and choose Cross-references to find every screen, alarm, script, and connection that uses a tag from this table. Any external reference prevents the table from being deleted cleanly.
  5. Reassign or delete referenced tags. Open each cross-reference result and either: (a) replace the tag with one from the default table, or (b) delete the screen/alarm/script that uses the tag. TIA Portal will not silently drop references – it will block the deletion with a dialog listing used tags.
  6. Right-click the user-created tag table. Confirm that Delete is available in the context menu. If grayed out, tags are still referenced – return to step 5.
  7. Select Delete. A confirmation dialog appears: "Do you really want to delete the tag table 'XYZ'?"
  8. Click Yes. The table is removed from the project tree and from the underlying project database.
  9. Save the project with Ctrl+S and recompile the HMI with Compile > Software (rebuild all) to confirm the HMI runtime images regenerate without errors.
Critical: Deleting a tag table is irreversible once the project is saved. There is no recycle bin. Maintain a project archive copy before bulk cleanup operations.

Alternative: Migrating Tags to the Default Table

If the goal is to consolidate all tags into a single container for tidiness, perform the following migration instead of deleting the table while it still holds references:

  1. Create the default table if it was renamed or hidden – right-click the HMI tags node and confirm a Default tag table exists.
  2. Open both tables side-by-side in the TIA Portal work area (drag the tab of one table to a second monitor or split view).
  3. Select all tags in the user-created table with Ctrl+A.
  4. Drag and drop the selection onto the default tag table node in the project tree, or copy with Ctrl+C and paste into the destination table.
  5. Resolve name conflicts. TIA Portal prevents pasting two tags with the same name into one table. Rename conflicts as needed before pasting.
  6. Verify external references in screens, alarms, and scripts now point to the tags in the default table. The cross-reference tool will update automatically when the source tag name is preserved during the move.
  7. Delete the now-empty user-created tag table using the procedure above.

Deleting Individual Tags Inside the Default Table

Engineers sometimes attempt to delete the default tag table because they want to clear its contents. The correct operation is to delete the tags themselves:

  1. Double-click the Default tag table in the project tree to open it.
  2. Click the first row, scroll to the last row, then Ctrl+Shift+Click the last row header to select all tags in the table.
  3. Press Delete on the keyboard.
  4. Confirm any "tags in use" warning by resolving the references first (step 5 of the previous procedure).
  5. Save and recompile.

This selection idiom (first row + scroll + Ctrl+Shift+Click last row) is identical to the procedure used to bulk-delete tags in the AutomationDirect C-More panel programming environment, where the same selection pattern applies in the C-More tag database editor.

Programmatic Deletion via TIA Portal Openness API

For projects with hundreds of tags or where multiple engineers share a cleanup workflow, the TIA Portal Openness API exposes a C# / VB.NET interface to delete tag tables and individual tags programmatically. This is the documented approach for automating mass cleanup before a build pipeline triggers a compile.

The Openness API exposes the HmiTagTable and HmiTag types under Siemens.Engineering.Hmi.Tag. A documented example for deleting an individual tag from an HMI tag table is shipped with the TIA Portal Openness help:

private static void DeleteATag(HmiTagTable hmiTagTable)
{
    // Locate the specific tag within the table
    HmiTag tagToDelete = hmiTagTable.Tags.Find("Motor1_Running");

    // Remove the tag from the table's tag collection
    hmiTagTable.Tags.Remove(tagToDelete);

    // Persist the change back to the project
    hmiTagTable.GetService<ITagTableService>().Update();
}

For deleting an entire table, the API uses HmiTargetFolder or direct Delete() on the tag-table object:

private static void DeleteATagTable(HmiSoftware hmiSoftware)
{
    HmiTagTable userTable = hmiSoftware.TagTables.Find("Motors");
    if (userTable != null && !userTable.IsDefaultTable)
    {
        userTable.Delete();
    }
}

Always guard the deletion with an IsDefaultTable check to mirror the UI behavior. The full Openness documentation is published in the TIA Portal help portal:

Build pipeline integration: Openness API scripts can be invoked from PowerShell or CI/CD runners to perform cleanup before compile. Always run in a controlled environment with a project backup, since Openness operations bypass the GUI confirmation dialogs.

Cross-Platform Reference: Tag Database Cleanup on Other HMI Systems

The "default table cannot be deleted" pattern is not unique to TIA Portal. The following table summarizes how competing HMI platforms expose tag-database deletion, since engineers frequently move between vendors:

Platform Default Tag Container Bulk Delete Method Reference
Siemens TIA Portal (WinCC) Default tag table – cannot be deleted Right-click user table → Delete; or Openness API HmiTagTable.Delete() TIA Portal Openness docs
Rockwell FactoryTalk View SE / Studio Default tag database file (RDB) Reduce DB size by clearing Cache/RDMDATA folder and pruning TAG folder contents Rockwell Knowledgebase 38064
AVEVA InTouch HMI Access Name / Tagname dictionary Home → Tags → Delete Unused Tags (automatic scan) AVEVA InTouch docs
AutomationDirect C-More Project tag database (single) Select all rows (row 1 + Ctrl+Shift+Click last row) → Delete key AutomationDirect C-More programming software help

Notice the philosophical differences: Siemens requires table-by-table manual deletion, AVEVA provides an automated "Delete Unused Tags" tool, FactoryTalk View relies on disk-level cleanup, and C-More uses keyboard-driven multi-select. The Siemens approach is most rigorous but most labor-intensive for large projects.

Verification Steps After Deletion

  1. Compile the HMI – Right-click the HMI device → Compile > Software (rebuild all). Confirm zero errors in the output window. A deleted table that left orphaned cross-references will surface here as Tag not found errors.
  2. Check cross-references – Use Ctrl+Shift+F11 or the project-tree Cross-references command to confirm no references to the deleted tags remain.
  3. Simulate runtime – Start the WinCC Runtime simulation (Tools → Start Runtime) and exercise screens that previously referenced the deleted tags. Screens should open without blank-tag warnings.
  4. Compare project size – The .ap* HMI source file size should decrease proportionally to the number of tags removed. A zero reduction indicates the deletion did not persist.
  5. Export tag listHMI tags → Export to CSV and confirm the deleted tags do not appear.

Troubleshooting Matrix

Symptom Likely Cause Resolution
Delete option grayed out on right-click Default tag table (cannot be deleted by design) Delete tags inside the table instead, or migrate contents to another user table and delete that
Delete option missing entirely Project opened read-only or from a library reference Open the project as an editable project; detach from global library if linked
Deletion blocked with "in use" dialog Tags still referenced by screens, alarms, scripts, or PLC tags Resolve each cross-reference listed in the dialog before retrying
Compile error after deletion: "Tag 'Motor1_Running' not declared" Tag table deleted but a screen still references a tag name from it Update screen object tag reference or recreate the tag in the default table
Openness API throws EngineeringTargetInvocationException Project not in an editable state or TIA Portal not running in API mode Launch TIA Portal with /Api command-line switch or attach via PortalProcess.Attach()
Renamed default table still cannot be deleted Internal default-flag property persists past rename Expected behavior – delete the tags, not the table
Tag table visible in one HMI device but not another Tag tables are scoped per HMI device Create the equivalent table under the second HMI device manually or via Openness API

Best Practices for Long-Term Tag Database Hygiene

  • Naming convention – Prefix tag tables by functional area (IO_Motors, IO_Valves, Recipes, Diagnostics) to make future cleanup predictable.
  • Default-table discipline – Reserve the default tag table for project-wide or PLC-connection-bound tags only; keep HMI-local tags in user-defined tables for easier deletion later.
  • Reference-driven deletion – Always run cross-references before deletion. Treat orphaned cross-references as compile-blockers, not warnings.
  • Version-controlled archives – Commit the project to a Git/SVN repository before bulk deletions. This provides an audit trail for rollback.
  • Openness automation – For projects with more than ~200 tags, write an Openness API cleanup script that identifies tables with zero cross-references and deletes them. This scales the manual procedure across multi-project deployment pipelines.
  • Avoid library copies – Master copies of tag tables in the global library can be deleted via right-click but the deletion must be performed on the library master, not on instance copies. Confirm the project tree shows the library source, not the instance copy, before deleting.

Frequently Asked Questions

Why can I delete one HMI tag table but not another in TIA Portal?

The table that cannot be deleted is the Default tag table, which is created automatically when the HMI device is added and is required by the WinCC runtime. Renaming the default table does not change its protected status. User-created tables can always be deleted through right-click → Delete.

How do I delete all tags from the default tag table?

Open the default tag table, click the first row, scroll to the last row, hold Ctrl+Shift and click the last row header to select every tag, then press the Delete key. Confirm any "tags in use" warnings by resolving references first. The empty default table itself must remain in the project.

Can I delete HMI tag tables programmatically using Openness API?

Yes. Use the HmiTagTable.Delete() method on user-created tables in a TIA Portal Openness C# / VB.NET script. Always check IsDefaultTable before calling Delete() to mirror the UI behavior and prevent runtime exceptions.

What happens to screens and alarms that reference a deleted tag table?

If a screen, alarm, or script still references a tag from the deleted table, the HMI compile fails with a "Tag not found" or "Symbol not declared" error. You must either re-create the tag in another table or update the screen/alarm reference to point to a different tag before the project compiles cleanly.

Is there an equivalent of "Delete Unused Tags" in TIA Portal?

No automated equivalent ships with TIA Portal. Engineers must delete tables/tags manually or via the Openness API by iterating cross-references. AVEVA InTouch exposes a native Home → Tags → Delete Unused Tags command for comparison, but TIA Portal requires explicit user action or a custom script.

Back to blog