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
- Open your footer in the Webflow Designer.
- Select just the year within your footer text and wrap it in a Span.
- Select that span and open Element settings → Custom attributes.
- Add an attribute with the name
data-yearand the valuetrue.
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.

.png)

.png)