{"id":495,"date":"2021-01-02T05:39:53","date_gmt":"2021-01-02T05:39:53","guid":{"rendered":"https:\/\/targetict.co.uk\/blog\/?p=495"},"modified":"2022-01-28T08:21:56","modified_gmt":"2022-01-28T08:21:56","slug":"how-to-keep-your-footer-copyright-year-auto-updated","status":"publish","type":"post","link":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html","title":{"rendered":"How to keep your footer copyright year auto updated."},"content":{"rendered":"<p>Its that time of the year again where the footer copyright year in almost every website becomes automatically outdated!!<\/p>\n<p>If you scroll to the bottom of your website, (most of the time)<!--more--> there is a notice there which has would usually be in the form, Copyright \u00a9 2021. Your Company Name.<\/p>\n<p>While a lot of clients and website owners forget to do it the start of every year, you are meant to change the year in this notice to match the current year!<br \/>\nWe made this post on Instagram after seeing the footer copyright year of a new client website we had a job to re-design &amp; update still stuck at 2003!<\/p>\n<blockquote class=\"instagram-media\" style=\"background: #FFF; border: 0; border-radius: 3px; box-shadow: 0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width: 540px; min-width: 326px; padding: 0; width: calc(100% - 2px);\" data-instgrm-captioned=\"\" data-instgrm-permalink=\"https:\/\/www.instagram.com\/p\/BsQmhwTnnYl\/?utm_source=ig_embed&amp;utm_campaign=loading\" data-instgrm-version=\"13\">\n<div style=\"padding: 16px;\">\n<p>&nbsp;<\/p>\n<div style=\"display: flex; flex-direction: row; align-items: center;\">\n<div style=\"background-color: #f4f4f4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;\"><\/div>\n<div style=\"display: flex; flex-direction: column; flex-grow: 1; justify-content: center;\">\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;\"><\/div>\n<\/div>\n<\/div>\n<div style=\"padding: 19% 0;\"><\/div>\n<div style=\"display: block; height: 50px; margin: 0 auto 12px; width: 50px;\"><\/div>\n<div style=\"padding-top: 8px;\">\n<div style=\"color: #3897f0; font-family: Arial,sans-serif; font-size: 14px; font-style: normal; font-weight: 550; line-height: 18px;\">View this post on Instagram<\/div>\n<\/div>\n<div style=\"padding: 12.5% 0;\"><\/div>\n<div style=\"display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;\">\n<div>\n<div style=\"background-color: #f4f4f4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);\"><\/div>\n<div style=\"background-color: #f4f4f4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);\"><\/div>\n<\/div>\n<div style=\"margin-left: 8px;\">\n<div style=\"background-color: #f4f4f4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;\"><\/div>\n<div style=\"width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg);\"><\/div>\n<\/div>\n<div style=\"margin-left: auto;\">\n<div style=\"width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);\"><\/div>\n<div style=\"background-color: #f4f4f4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);\"><\/div>\n<div style=\"width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);\"><\/div>\n<\/div>\n<\/div>\n<div style=\"display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;\">\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;\"><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; line-height: 17px; margin-bottom: 0; margin-top: 8px; overflow: hidden; padding: 8px 0 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap;\"><a style=\"color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 17px; text-decoration: none;\" href=\"https:\/\/www.instagram.com\/p\/BsQmhwTnnYl\/?utm_source=ig_embed&amp;utm_campaign=loading\" target=\"_blank\" rel=\"noopener noreferrer\">A post shared by Target ICT (@targetict)<\/a><\/p>\n<\/div>\n<\/blockquote>\n<p><script async src=\"\/\/www.instagram.com\/embed.js\"><\/script><\/p>\n<p>We would usually charge a small fee to update this every year but as business owners, we always help clients save money as we know every pence counts so what if we showed you how to get rid of paying\u00a0 this annual fee, forever?<\/p>\n<p>You might be wondering, why is updating the footer copyright year important? It&#8217;s just a little part of the website?<\/p>\n<p>Let&#8217;s look at it this way, if you were searching for a Software Developer for your business and found Target ICT and a few others online, after making comparisons you scrolled to the bottom of their websites and realized one of the companies still had year 2015 in their footer won&#8217;t you feel the company has gone out of business?<\/p>\n<p>Apart from this, having this part of your website out of date can negatively affect your <a href=\"https:\/\/targetict.co.uk\/blog\/what-is-seo-on-a-website.html\">SEO (Search Engine) rankings<\/a>.<\/p>\n<p>That&#8217;s the same way a lot of potential clients might feel when they see outdated information on your Business website!<\/p>\n<p>When <a href=\"https:\/\/targetict.co.uk\/blog\/why-re-design-your-business-website.html\">we build websites for clients,<\/a> we always make sure this inconvenience is eliminated completely by ensuring the year updates itself automatically.<\/p>\n<p>In this post, you would see how that can be done on your website and we would cover the most popular languages websites are built in these days.<\/p>\n<h3><strong>How to edit your website footer to make the year auto-update<\/strong><\/h3>\n<p>While so many websites are built on content management systems these days, there are others (like our main website) which are built with pure HTML\/PHP\/Javascript for ease of manipulation and to get rid of bloat.<\/p>\n<p>In other to keep your copyright year updated, we would list instructions for some popular languages below &#8211; Javascript, PHP, Django, node.js and ASP.net.<\/p>\n<p>If you are confused on <a href=\"https:\/\/targetict.co.uk\/blog\/how-to-make-changes-to-your-website.html\">how to make changes to your website<\/a> you can check our previous post on that.<\/p>\n<h4><strong>How to set your website footer year to auto-update in JavaScript<\/strong><\/h4>\n<p>Javascript is a Client Side scripting language (it makes changes in the browser) which has been gaining a lot of popularity of recent.<\/p>\n<p>We have a lot of websites built with\u00a0 plain javascript and the various frameworks such as React, Vue.js, Angular and the like.<\/p>\n<p>The code for Javascript is as below (replace the year with the code below) :<\/p>\n<p><strong>To add just the year<\/strong><\/p>\n<pre>&lt;script type=\"text\/JavaScript\"&gt;\r\ndocument.write(new Date().getFullYear());\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>This would give you<\/p>\n<pre>2021<\/pre>\n<p><strong>To\u00a0 use a start and end year (e.g 2010 -2021)<\/strong><\/p>\n<pre>&amp;copy; 2010&lt;script&gt;new Date().getFullYear()&gt;2010&amp;&amp;document.write(\"-\"+new\r\n\r\nate().getFullYear());&lt;\/script&gt;, Your Company name.<\/pre>\n<p>This would come out as:<\/p>\n<pre>\u00a9 2010-2021, Your Company name.<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong>Configuring your PHP website to auto update footer year.<\/strong><\/h4>\n<p>Majority of the Websites online worldwide are built with or support PHP and this is likely to be the case for a very long time.<\/p>\n<p>PHP unlike Javascript is a server side scripting language (code is translated at the server before the site is shown on the browser).<\/p>\n<p>Like with Javascript, PHP has a lot of CMS (like WordPress, Joomla, etc) and frameworks (like Laravel, CakePHP, etc) but below, we would be giving the code to keep your footer year auto-updated with plain PHP.<\/p>\n<p><strong>To add just the year:<\/strong><\/p>\n<pre>&lt;?php echo date(\"Y\"); ?&gt;\r\n\r\n<\/pre>\n<p>This would show as:<\/p>\n<pre>2021<\/pre>\n<p><strong>To\u00a0 use a start and end year (e.g 2010 -2021)<\/strong><\/p>\n<pre>&amp;copy; &lt;?php\r\n$fromYear = 2010;\r\n$thisYear = (int)date('Y');\r\necho $fromYear . (($fromYear != $thisYear) ? '-' . $thisYear : '');?&gt;, Your Company name.<\/pre>\n<p>This would come out as:<\/p>\n<pre>\u00a9 2010-2021, Your Company name.<\/pre>\n<h4><strong>Automating your footer copyright year with node.js<\/strong><\/h4>\n<p>Node.js is one of the popular javascript frameworks used in building websites these days.<\/p>\n<p>You can automate the footer date year in your Node.js application by using the following:<\/p>\n<pre>new Date().toISOString().substr(0,4)<\/pre>\n<p>This would show as:<\/p>\n<pre>2021\r\n\r\n<\/pre>\n<h4 id=\"Wix\"><strong>How to keep your Wix website footer copyright year auto updated<\/strong><\/h4>\n<p>Wix is a really old and popular website builder used by <a href=\"https:\/\/w3techs.com\/technologies\/details\/cm-wix\">almost 2%<\/a> of websites globally.<\/p>\n<p>Wix uses React.js, the popular javascript framework and automating your footer year with Wix is easy!<\/p>\n<p>Look for your masterpage.js file in the #footerCopyright section and replace the year with with the following code:<\/p>\n<pre>const year = new Date().getFullYear();<\/pre>\n<p>This replaces the year written with the current year.<\/p>\n<p>An example is:<\/p>\n<pre>$w.onReady(function () {\r\n\/\/ Footer Copyright Date - Velo masterPage,js Template by Great Lakes Multimedia \/\/\r\n    const year = new Date().getFullYear();\r\n    $w('#footerCopyright').text = `\u00a9 ${year} Your Company Name \\nProudly created with Wix.com`;\r\n});\r\n<\/pre>\n<p>The ${year} ensures the current year is always displayed<\/p>\n<h4><strong>Keeping your copyright year auto-updated with Django<\/strong><\/h4>\n<p>Python is a really popular multipurpose language which has gained attention of recent.<\/p>\n<p>Django is a framework which is commonly used in building Python applications\u00a0 and to automate the footer in your Django application, you can use the following code to replace the year written:<\/p>\n<pre>{%now \"Y\"%}<\/pre>\n<p>This would show as:<\/p>\n<pre>2021<\/pre>\n<h4><strong>How to keep footer year current with ASP.NET (dot Net)<\/strong><\/h4>\n<p>ASP. net has been used for decades in building web applications and the footer of an ASP enabled website can be automated by replacing the year typed there with the following code:<\/p>\n<pre>Copyright @@ @DateTime.Now.Year\r\n<\/pre>\n<p>This would show as:<\/p>\n<pre>Copyright 2021<\/pre>\n<p>&nbsp;<\/p>\n<p>That&#8217;s it!<\/p>\n<p>1 less thing\u00a0 to bother about.<\/p>\n<p>If you would like us to do this for you, you can always <a href=\"https:\/\/targetict.co.uk\/contact.html\">Contact Us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Its that time of the year again where the footer copyright year in almost every website becomes automatically outdated!! If you scroll to the bottom of your website, (most of the time)<\/p>\n","protected":false},"author":1,"featured_media":506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[120],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.1 (Yoast SEO v23.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to keep your footer copyright year auto updated.<\/title>\n<meta name=\"description\" content=\"Every year, the footer copyright year in your website gets outdated. In this tutorial, we would show different ways you can automate updating your footer.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to keep your footer copyright year auto updated.\" \/>\n<meta property=\"og:description\" content=\"Every year, the footer copyright year in your website gets outdated. In this tutorial, we would show different ways you can automate updating your footer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Target ICT Ltd\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/targetict\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-02T05:39:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-28T08:21:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Content Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@targetict\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Content Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to keep your footer copyright year auto updated.","description":"Every year, the footer copyright year in your website gets outdated. In this tutorial, we would show different ways you can automate updating your footer.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html","og_locale":"en_GB","og_type":"article","og_title":"How to keep your footer copyright year auto updated.","og_description":"Every year, the footer copyright year in your website gets outdated. In this tutorial, we would show different ways you can automate updating your footer.","og_url":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html","og_site_name":"Blog - Target ICT Ltd","article_author":"https:\/\/facebook.com\/targetict","article_published_time":"2021-01-02T05:39:53+00:00","article_modified_time":"2022-01-28T08:21:56+00:00","og_image":[{"width":800,"height":420,"url":"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png","type":"image\/png"}],"author":"Content Team","twitter_card":"summary_large_image","twitter_creator":"@targetict","twitter_misc":{"Written by":"Content Team","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html","url":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html","name":"How to keep your footer copyright year auto updated.","isPartOf":{"@id":"https:\/\/targetict.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html#primaryimage"},"image":{"@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html#primaryimage"},"thumbnailUrl":"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png","datePublished":"2021-01-02T05:39:53+00:00","dateModified":"2022-01-28T08:21:56+00:00","author":{"@id":"https:\/\/targetict.co.uk\/blog\/#\/schema\/person\/1283a50e1a5fc8a1ff6946640404b76b"},"description":"Every year, the footer copyright year in your website gets outdated. In this tutorial, we would show different ways you can automate updating your footer.","breadcrumb":{"@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html#primaryimage","url":"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png","contentUrl":"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png","width":800,"height":420,"caption":"How to keep your website footer copyright year auto updated."},{"@type":"BreadcrumbList","@id":"https:\/\/targetict.co.uk\/blog\/how-to-keep-your-footer-copyright-year-auto-updated.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/targetict.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"How to keep your footer copyright year auto updated."}]},{"@type":"WebSite","@id":"https:\/\/targetict.co.uk\/blog\/#website","url":"https:\/\/targetict.co.uk\/blog\/","name":"Blog - Target ICT Ltd","description":"Our Latest Articles","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/targetict.co.uk\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/targetict.co.uk\/blog\/#\/schema\/person\/1283a50e1a5fc8a1ff6946640404b76b","name":"Content Team","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/targetict.co.uk\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/58b50ad253fa5d4d8768740e8b0530d0?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/58b50ad253fa5d4d8768740e8b0530d0?s=96&r=g","caption":"Content Team"},"sameAs":["https:\/\/targetict.co.uk","https:\/\/facebook.com\/targetict","https:\/\/instagram.com\/targetict","https:\/\/x.com\/targetict","https:\/\/www.youtube.com\/channel\/UCXHSIBb0zQxQaPLdJkGILpw"],"url":"https:\/\/targetict.co.uk\/blog\/author\/writer"}]}},"jetpack_featured_media_url":"https:\/\/targetict.co.uk\/blog\/wp-content\/uploads\/2019\/01\/keep-footer-copyright-year-updated.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/posts\/495"}],"collection":[{"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":13,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":667,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/posts\/495\/revisions\/667"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/media\/506"}],"wp:attachment":[{"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/targetict.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}