To find and replace text across every page of a static website, use a tool that can search all the HTML files in your site folder at once, such as a code editor or HTML editor with site-wide find and replace. Make a backup first, search for the exact old text, review every match, and only then replace. Afterwards, open a few pages to confirm the change looks right.
This guide walks through doing it safely, explains the search options that prevent mistakes, and covers common jobs like updating a phone number, address, link or copyright year.
When you need a site-wide replace
On a static site, text that appears on every page is usually copied into every file. That includes:
- Phone numbers, email addresses and street addresses in the header or footer.
- The copyright year, such as "© 2025".
- Menu items and links to a page that has been renamed.
- Your business name, after a rebrand.
- Links to an old domain or to
http://addresses that should now behttps://. - The address of a stylesheet or script that has moved.
Editing these one page at a time is slow and easy to get wrong. A site-wide replace changes them all in one pass.
Step 1: Back up your site
A site-wide replace changes many files at once. If the search matches something you did not expect, it changes that too. Before you start, copy your whole site folder somewhere safe, or zip it. If you use version control, commit your work first. This is the single most important step, because some tools cannot undo a replace across many files.
Step 2: Search before you replace
Run a search on its own first and read the results. A good tool lists each file and the line where the text appears. Check:
- The number of matches. If you expect one per page and you have 20 pages, you should see about 20.
- Where they are. Matches inside code, such as a CSS class name or a file path, may need different treatment from matches in visible text.
- Different spellings. A phone number may be written as
555-0100on some pages and555 0100on others. Search for each form.
Remember that the same text often appears twice on a page: once in what visitors see and once in a link. A phone number might be in the text and in a tel: link, and an email address in the text and in a mailto: link. Make sure both get updated.
Step 3: Choose the right search options
Most find and replace tools offer a few options. Using them well is what keeps a replace safe.
| Option | What it does | When to use it |
|---|---|---|
| Match case | Only matches the same capital and small letters | Names and brand terms, so "Apollo" does not match "apollo.css" |
| Whole word | Skips matches inside longer words | Short words, so "art" does not match "start" |
| File types or folder | Limits the search to certain files | Search only .html files, or only one section of the site |
| Regular expressions | Matches text by pattern, not exact wording | Advanced changes, such as any four-digit year after "©" |
A note on regular expressions
Regular expressions are a pattern language. For example, the pattern \d{4} matches any four digits. That is useful when the text you want to change varies slightly between pages, but a pattern that is too broad can change far more than you meant. Always run the search on its own first and read the matches before replacing. If you are not comfortable with patterns, run a few plain searches instead.
Step 4: Replace and review
- Enter the old text and the new text exactly. Watch for extra spaces.
- If your tool lets you step through matches, replace them one by one for the first few files to check the result.
- When you are confident, replace the rest.
- Open several changed pages in a browser and check the new text, links and layout.
- Search for the old text again. You should get no results, or only ones you meant to keep.
- Upload the changed files to your web host.
Common jobs and how to handle them
Updating the copyright year
Search for the full phrase, such as © 2025 or © 2025, rather than just 2025. Searching for the year alone may also change dates in articles, file names or prices. Note that your pages might use the character © in some places and the HTML entity © in others, so search for both.
Changing a link after renaming a page
Search for the old file name, for example old-services.html, so you catch links from pages in different folders that use different relative paths. Better still, use a tool that updates internal links for you when you rename a page.
Moving from http to https
Search for http://www.example.com and replace it with https://www.example.com. Searching for http:// alone would also change links to other sites, some of which may not support https.
The easier way: site-wide find and replace in Apollo Editor
Apollo Editor is a Windows desktop HTML editor that includes search across the whole site and find and replace across files in its Site Explorer, so you can make these changes without opening each page.
- Search across the whole site to see where text appears before you change anything.
- Find and replace across files for phone numbers, years, names and links.
- Automatic internal link updates (after asking) when you rename or move a page, so you do not need a replace for that job.
- Shared headers and footers, so details in those areas live in one place to begin with.
Your pages stay as plain HTML files, so a backup is just a copy of the folder. For related tasks, read how to keep the same header and footer on every page, how to find broken links and how to edit an existing HTML website.
Frequently asked questions
Can I change the copyright year on every page at once?
Yes, with a site-wide find and replace. Preview the matches first so only the right text changes.
What is a regular expression in find and replace?
A pattern language that matches text by shape rather than exact wording. It is powerful but easy to get wrong, so test it first.
How do I undo a site-wide replace?
Keep a backup or use an editor with undo for the operation. Without one, the only way back is to replace the text again by hand.
