Hello Osmo
← All article

Automatically update your footer year in Webflow

The footer still says last year. Easy to miss. Also easy to automate.

This script updates the year whenever someone loads your Webflow website.

Mark the year in Webflow

  1. Open your footer in the Webflow Designer.
  2. Select just the year within your footer text and wrap it in a Span.
  3. Select that span and open Element settings → Custom attributes.
  4. Add an attribute with the name data-year and the value true.

Keep the attribute on the year alone. The script replaces all text inside the element carrying it.

Add the script

Open Site settings → Custom code and paste this into Footer code:

<script>
  function initDynamicCurrentYear() {
    const currentYear = new Date().getFullYear();

    document.querySelectorAll('[data-year]').forEach((element) => {
      element.textContent = currentYear;
    });
  }

  if (document.readyState === 'loading') {
    document.addEventListener(
      'DOMContentLoaded',
      initDynamicCurrentYear
    );
  } else {
    initDynamicCurrentYear();
  }
</script>

Save and publish your website, then check the footer on the published version.

The script uses the year from the visitor's device. If your footer is a shared Webflow component, add the attribute inside the main component so its instances receive the change.

‍

Change the text selection color in Webflow
Resources
November 11, 2026

Change the text selection color in Webflow

Make selected text match your website's colors with a small CSS snippet in Webflow.
Match the browser toolbar to your Webflow website
Resources
November 11, 2026

Match the browser toolbar to your Webflow website

A small JavaScript snippet keeps your footer year current, so January doesn't come with another website task.
Who is gonna suffer from the complexity
Engineering
November 11, 2026

Who is gonna suffer from the complexity

An easy-to-use website takes work somewhere. The question is whether your development team does that work or leaves it for your visitors and the people managing the website.

Ready to get started?

Incroy brings your business to life online with a site that’s modern, functional, and built the right way, from the first step to the final launch. We’re ready and raring to go when you are.

Chat with us

Heading