How to Remove Private Text From Macros Before You Share Them
Open the exported copy and make four passes for names, numbers, links and secrets. Replace each hit with a bracketed placeholder, delete any macro that types a login, and test the cleaned file on a clean profile before sending.
| Applies to | Windows 10 and Windows 11 |
|---|---|
| Time needed | 15 minutes |
| Difficulty | Easy |
| Cost | Free |
| Admin or internet | Neither |
| Last verified | November 2026 |
01 // BEFORE IT LEAVES YOUR PC
Part of our guide to how to back up and share keyboard macros. The test this page belongs to is described in the section on backing up and sharing.
Four Passes That Find Private Text
Scrubbing a macro file means making four passes over the text for names, numbers, links and secrets, then replacing each hit with a bracketed placeholder. A macro file looks harmless because each line is short, yet a library of fifty snippets often holds a surprising amount about its owner.
| Pass | Look for | Why it matters | Replace with |
|---|---|---|---|
| 1. Names | Client, patient, colleague and company names | They identify real people and accounts | [Client name] |
| 2. Numbers | Account numbers, phone numbers, ID numbers, long digit runs | They are easy to reuse and hard to revoke | [Number] |
| 3. Links | Email addresses, internal web addresses, file paths with a user name | They reveal your systems and your account | [Address] or [Link] |
| 4. Secrets | Passwords, PINs, licence keys, tokens | They grant access on their own | Delete the macro, use a password manager |
Use the Search Box, Not Your Eyes
Open the copy in Notepad and use Find for each search term. Eyes skip over a long line, and the search box does not. Search the terms below, one at a time, and fix every hit.
@
http
www
pass
pin
key
token
.com
C:\UsersFor long digit runs, scan the numbers pass by eye after the text search, since Notepad’s Find has no pattern for digits.
Passwords Do Not Belong in Macros
A login stored as macro text is just ordinary characters, so each copy of the file carries it along. Shell history shows the same effect, since secrets typed into a command line are saved in plain text, as this article on secrets at the command line explains. A password manager fills logins without storing them in a file you share.
If a macro types a login, delete that macro from the shared copy and from your own library, then change the password if the file already left your PC.
Before and After
Before
,bank Pay to Example Trading Ltd, account 00000000, ask for jordan@example.com
After
,bank Pay to [Company name], account [Number], ask for [Address]
Lock the File You Send
A scrubbed file is safe to share, but you may still want to protect it in transit. Encrypting before upload keeps a copy private even if the storage service is exposed, as this guide to encrypted backups describes. A folder-locking program such as Folder Lock can do that for a macro folder.
Work Data and Policy
Client names, internal addresses and anything covered by a confidentiality agreement stay out of shared macros even when your employer allows macros. If you are unsure, ask your IT or compliance team before the file leaves the building.
Questions About Scrubbing
No. Your private backup keeps the full text so you can restore everything. Scrub only the copy you share, and keep the two clearly named.
Yes for names, numbers and links, because the macro still works as a template. Delete any macro that types a login.
Scrub it anyway. Colleagues leave, files get forwarded, and a library with private text becomes a record that outlives the reason you shared it.
Import it on a clean profile and run a macro of each type. The restore test takes a few minutes and catches placeholders left in the wrong place.
NEXT STEP
Try the free export route
Macro Keys is a free Windows program that lists each macro’s trigger and text in one table, which makes the scrub passes quicker. Review that list before you export.