Bulk Replace
Web and code

How to Update the Copyright Year on Every Page of a Static Website

Change the copyright year in the footer of every HTML page in one pass. Regex for single years and ranges, what not to touch, and a way to stop doing it.

Updated 5 minute read The Bulk Replace team

To update the copyright year in all your HTML files, run one find and replace across the site folder. If every footer says exactly the same thing, a plain-text replace such as © 2025 → © 2026 is enough. If the footers vary, a regex such as (Copyright|©|©|\(c\))(\s*)(\d{4})\s*-\s*\d{4} replaced with $1$2$3-2026 updates every year range in one pass while keeping the start year. Better still, make the year update itself so you never need to do this again.

Below are the patterns for each footer style, a safe run order, and the options for making the year automatic.

Step 1: see what your footers actually say

Before writing a pattern, search the site for Copyright, © and the © symbol and look at the variety. Typical forms:

  • © 2025 Acme Ltd (HTML entity)
  • © 2025 Acme Ltd (the actual symbol, saved in the file as UTF-8)
  • Copyright © 2019-2025 Acme (a range)
  • (c) 2024 (plain text)
  • © 2025 (numeric entity)

Mixed forms are normal on sites that grew over time or have several templates. Our guide to finding all files containing text on Windows shows quick ways to list them with counts.

Step 2: choose the right pattern

All footers identical: plain text

  • Find: © 2025 Acme Ltd
  • Replace: © 2026 Acme Ltd

Including the company name makes the match specific, so a year mentioned in an article or a price table is not changed by accident.

Update the end of every year range

  • Find: (Copyright|©|©|©|\(c\))(\s*)(\d{4})\s*-\s*\d{4}
  • Replace: $1$2$3-2026

This keeps the symbol (group 1), the spacing after it (group 2) and the start year (group 3), and rewrites the end year. Copyright © 2019-2025 becomes Copyright © 2019-2026, and Copyright 2019 - 2024 becomes Copyright 2019-2026.

Turn a single year into a range

  • Find: (Copyright|©|©|©|\(c\))(\s*)(\d{4})(?!\s*-\s*\d)
  • Replace: $1$2$3-2026

The negative look-ahead (?!\s*-\s*\d) skips years that are already the start of a range, so running both rules does not produce 2019-2026-2025. Pages that already show 2026 on its own would become 2026-2026; add (?!2026) before (\d{4}) to leave those alone.

Replace a single year with the new year

If you prefer a single current year instead of a range:

  • Find: (Copyright|©|©|©|\(c\))(\s*)\d{4}(\s*-\s*\d{4})?
  • Replace: $1${2}2026

The braces in ${2}2026 stop the replacement being read as group 22. For more on this trap, see regex replace with capture groups.

Step 3: run order and scope

  1. Back up the site folder or commit it.
  2. Limit the run to template and page files: .html, .htm, .php, and any include or partial files. Leave out blog posts, changelogs and data files where old years are content, not footers.
  3. Run the range rule first, then the single-year rule.
  4. Review the matches. Each file should usually have exactly one match. A file with several matches deserves a closer look.
  5. Apply, then open a few pages in the browser.

Doing it with preview and undo

A year update is a small change spread across every page, which is exactly where a preview helps. In Bulk Replace, choose the site folder with sub-folders included, filter to .html .htm .php, and add the rules above as stacked regex rules in order. The before/after diff shows each footer change file by file with a total match count, so a page where the pattern caught a year in body text stands out and can be unticked. Bulk Replace backs up the files first, and each one keeps its encoding, which matters when the footer contains the raw © character. Save the folder, filters and rules as a project, and next January the whole update is two clicks.

PowerShell alternative

Get-ChildItem -Recurse -File -Include *.html,*.htm,*.php | ForEach-Object { $t = [IO.File]::ReadAllText($_.FullName); $n = $t -replace '(Copyright|©|\(c\))(\s*)(\d{4})\s*-\s*\d{4}','$1$2$3-2026'; if ($n -ne $t) { [IO.File]::WriteAllText($_.FullName, $n); $_.FullName } }

ReadAllText and WriteAllText detect a byte order mark if there is one, otherwise read the file as UTF-8, and write UTF-8 without a BOM, which avoids the ANSI problems of Set-Content in Windows PowerShell 5.1. If your footers use the raw © symbol, add it to the pattern in a script saved as UTF-8 with BOM, or use \u00A9 in the regex instead. Back up first: there is no undo.

Before applying any year rule across a whole site, check the preview for matches like these, which you probably want to leave alone:

  • Image credits and quotations, such as Photo © 2018 Jane Doe, where the year belongs to someone else's work.
  • Licenses and notices for third-party scripts in .js and .css files, such as a library's own copyright line. Keep those files out of the run.
  • Archived pages, press releases and old blog posts, where the original year is part of the record.
  • Legal pages that state a specific date of effect.

Including the company name in the pattern, for example (©\s*)(\d{4})(\s+Acme), is the simplest way to limit the change to your own notices.

Make the year update itself

Site typeApproach
PHP pagesReplace the year with <?php echo date('Y'); ?>, for example &copy; 2019-<?php echo date('Y'); ?>
Static site generatorUse the generator's current date variable in the footer template, then rebuild each year
Plain static HTMLUse a server-side include, or a small script that writes the year; the regex method above remains the simplest
CMSMost themes have a footer setting or shortcode for the current year

You can use the same bulk replace to make the switch once: find the year range and replace it with the PHP snippet across every .php file.

Check the result

  1. Search for the old year next to your company name. The count should be zero.
  2. Search for 2026-2026 or a doubled range like -2026-, which point to a rule that ran twice.
  3. Open the home page and a deep page in a browser to confirm the footer renders correctly.

Is updating the year required?

Copyright protection does not depend on the footer notice being current, so an old year is not a legal problem. It is a credibility problem: visitors read © 2019 as a sign the site is not maintained. Many sites use a range from the year the content was first published to the current year, which is a widely used convention.

If your footers also need other changes, such as a new address or menu links, see how to replace the header and footer in multiple HTML files.

Frequently asked questions

Do I have to update the copyright year every January?

It is not legally required, but an old year can make a site look neglected. Many sites show the first year and the current year, such as 2019-2026.

How can I make the year update automatically?

On a PHP page, print date('Y') where the year goes. On a static HTML page a small script can write the year, but a server-side value or a build step is more reliable.

Which regex matches a copyright year?

(&copy;|\(c\)|Copyright)\s*(\d{4}) captures the symbol and the year, so you can rewrite it as $1 $2-2026 or update an existing range instead.

Get three guides like this every month, plus software update notices.Subscribe →