# Admin tool of the week: Whitespace Remover Tool

**URL:** <https://community.dhis2.org/t/admin-tool-of-the-week-whitespace-remover-tool/77703>\
**Category:** Development - Développement\
**Tags:** tracker, maps, admin-tool-weekly\
**Created:** [23 October 2026 16:06 UTC](https://community.dhis2.org/t/admin-tool-of-the-week-whitespace-remover-tool/77703 "2026-10-23T16:06:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olav](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/o/0ea827/32.png) [@Olav](https://community.dhis2.org/u/Olav)\
**Post date:** [23 October 2026 16:06 UTC](https://community.dhis2.org/t/admin-tool-of-the-week-whitespace-remover-tool/77703/1 "2026-10-23T16:06:51Z")

</div>

> ℹ **Admin tool of the week:** this post is part of a weekly series featuring small, open-source maintenance tools from the HISP Centre for DHIS2 system administrators. [Read about the series](https://community.dhis2.org/t/introducing-admin-tool-of-the-week-tools-for-dhis2-system-administrators/77511).

 ![Whitespace Remover Tool listing data elements with extra whitespace](https://dhis2.b-cdn.net/uploads/default/original/3X/9/6/9640ae45c92cc35865448b3680153263b0ecad7e.png)

### The problem

A space at the end of a name, two spaces where there should be one, or a line break hidden inside a code: extra whitespace is invisible in most of DHIS2, but it still causes trouble:

- **Look-alike duplicates.** “ANC 1st visit” and "ANC 1st visit " look the same in every list, so it is easy to create or pick the wrong one.
- **Broken matching.** Imports, scripts and integrations that match on names or codes fail on a stray space without saying why.
- **Untidy output.** Double spaces show up in dashboards, reports and data entry forms.

Extra whitespace gets in through copy-pasting from spreadsheets and documents, imports and years of manual edits. Finding it through the Maintenance app means checking objects one by one.

### What the tool does

**Whitespace Remover Tool** scans the _name_, _short name_, _code_ and _description_ of your metadata for extra whitespace:

- In names, short names and codes: whitespace at the start or end, two or more spaces in a row, and any **line break, tab or non-breaking space**. The tool replaces each of these with a single space.
- In descriptions: whitespace at the start or end and repeated spaces between words. Line breaks are kept, so paragraphs and lists stay as they are.

You get one tab per metadata type (data elements, indicators, data sets, programs, program rules, org units, category options, options and more), with the extra whitespace highlighted. Characters you can’t see get a symbol, such as ↵ for a line break.

 ![Category option codes with a hidden line break, shown as ↵](https://dhis2.b-cdn.net/uploads/default/original/3X/c/5/c58fc826dc1dcd42c1734d57dea7678b7233b0f8.png)

Fixing is a two-step process:

1. **Check** makes sure that removing the whitespace will not create a duplicate. For example, if “Stock PHU dispensed BCG” already exists, removing the double space from “Stock PHU dispensed BCG” would give two objects with the same name. The tool flags this as a **conflict** and leaves that object for you to sort out by hand.
2. **Fix** removes the whitespace and saves the object. You can only fix objects that passed the check. If DHIS2 rejects a fix, the results show the reason.

You can check and fix a single object, or select many at once and use _Check selected_ and _Fix selected_.

![Checking all data elements for conflicts and fixing the rest](https://dhis2.b-cdn.net/uploads/default/original/3X/c/4/c42d3612eaefc42a144225035afdadc3234e3c02.gif)

### Try it on the demo instance

You can try the tool without installing anything: open [implement.im.dhis2.org/tools/apps/tool-whitespace-remover](https://implement.im.dhis2.org/tools/apps/tool-whitespace-remover) and log in as **tools** / **District1#**. The demo is a copy of the Sierra Leone demo database.

### Use with care

- **Check where names and codes are used before you fix them.** DHIS2 itself refers to metadata by ID, which the tool never changes. But data exchanges, ADX imports, imports using the code or name ID scheme, and external systems or scripts may match on the exact name or code. If they do, a fix can quietly stop data from being imported or exchanged. Only fix such objects when you can update the other side at the same time.
- The fix changes metadata in place, and the tool has **no undo**. Try it on a test instance first and have a backup before using it in production.
- Some values are never changed, because data or rules depend on the exact value: **option codes** and **program rule variable names**. The tool shows their whitespace in red and marks such objects _Fix manually_.
- Visualizations, maps and category option combinations are not included. Rename visualizations and maps in their own apps.
- The tool only sees **metadata you have access to**. For a complete scan, use an account with the `ALL` authority.

### Get it

- **Supported DHIS2 versions:** 2.41 and later (tested on 2.41, 2.42 and 2.43)
- **Download:** Download the latest version from [https://github.com/dhis2-utils/tool-whitespace-remover/releases](https://github.com/dhis2-utils/tool-whitespace-remover/releases), then install it in the App Management app (_Upload app_)
- **Documentation and source:** [github.com/dhis2-utils/tool-whitespace-remover](https://github.com/dhis2-utils/tool-whitespace-remover) (see the [user guide](https://github.com/dhis2-utils/tool-whitespace-remover/blob/main/docs/user/tool-whitespace-remover.md))
- **Authorities:** _Export metadata_ to scan, and update rights plus metadata write sharing on the objects you want to fix
- **Already using the older “Whitespace Cleaner Tool”?** The current version is installed as a separate app. Uninstall the old one after installing it, and add the new app to the user roles that had the old one.

Questions, bugs or ideas? Reply below.

[**Click here to receive notifications for #admin-tool-weekly topics: ![](https://dhis2.b-cdn.net/uploads/default/original/3X/6/5/65d3ec3e7695e2bc3f687f58d8e6f4e2ca34946f.png)**](http://community.dhis2.org/subscribe-admin-tool-weekly)
