How to Add a Copyright Notice in WordPress

Almost every website that you find on the Internet will have a copyright notice which gives basic information about the site. Even though the law has changed and placing a copyright symbol won’t actually protect your work, there is an unwritten rule for web designers to put a notice in the footer of the website they have created.

Usually, a copyright notice is a simple text that consists of just a few elements. 

To create one, you will need:

  • copyright symbol
  • date of creation
  • author name
  • rights statement

As we already told you, you are free to add anything you want. You don’t have to put a copyright symbol if you don’t want to, you may use a link to your notice or any other text that you like.

How to create a dynamic copyright notice

OK, we guess you’re not here to read about copyright notice itself but you want to know how to create one in WordPress. Possibly, create one which will dynamically change so you don’t have to update your footer every year just to change the label. Let’s create one and stop worrying about a copyright notice in the future. If you don’t want to modify the code, you can use a plugin to do the same job for you.

  1. Copy the following code and paste it in your theme’s functions.php file :
function create_copyright() {
  $all_posts = get_posts( 'post_status=publish&order=ASC' );
  $first_post = $all_posts[0];
  $first_date = $first_post->post_date_gmt;
  _e( 'Copyright © ' );
  if ( substr( $first_date, 0, 4 ) == date( 'Y' ) ) {
    echo date( 'Y' );
  } else {
    echo substr( $first_date, 0, 4 ) . "-" . date( 'Y' );
  }
  echo ' <strong>' . get_bloginfo( 'name' ) . '</strong> ';_e( 'All rights reserved.' );
}
  1. Save changes
  2. Open footer.php file
  3. Find the copyright information you already have in the theme (if there is one) and replace it with the following PHP code.

For example, if you are working with Twenty Seventeen theme, in the footer area you will find the HTML code which echoes “Proudly powered by WordPress” notice. Simply overwrite that code with this one:

<?php create_copyright(); ?>
  1. Save changes

If you haven’t changed anything in the code, your newly created copyright notice should look something like this:

Copyright © 2017 First Site Guide All rights reserved.

If you only wanted to change the copyright notice, you’re done. In the next few lines, we’re going to explain the code provided above.

The function provided above searches for all posts in your WordPress directory. It gets the first one ever published and fetches its date. This part is important if you had started working on your WordPress project in the last few years. If so, the copyright notice will automatically write the year when you started and add the current year where necessary. If you have started the blog this year, it will only display the current year.

After that, the function writes “Copyright” text followed by a well-known © symbol and adds your blog name from your General Settings page. In the end, there will be “All rights reserved” text which you can of course change to whatever you want.

Add a copyright notice to the clipboard when someone copies a text

Once you decide to publish something on the Internet, you won’t be able to stop people from copying your content. You know that, and there’s practically nothing you can do about it. Whether it is only a sentence or you have written an entire story, whether it’s a photograph or an image you have drawn, a video you have created or anything else, it will become public and accessible to practically anyone, no matter what you do to protect it.

Even if you take extra precaution measures and make your content more secure, you will never be able to make it completely copy-proof.

Having that in mind, you can still make an effort and create warnings and copyright notices, or even try to disable copying entirely. One of the other things you can do is to add a link to the text which people can copy from your site and make them paste that in addition. You have probably seen the feature in action on one of many popular websites which do so. If you copied text from their website, you ended up in having additional text saying something like “Read more at www.domain.com”.

Instead of blocking people from copying text from your website (they will find a way around if they really want to), you can simply add the name of your website and link to the original post.

Add a link to any copied text from your site:

  1. Open footer.php
  2. Copy and paste the following code:
<script type="text/javascript">
  function addLink() {
    //Get the selected text and append the extra info
    var selection = window.getSelection(),
    pagelink = '<br /><br /> Read more at: ' + document.location.href,
    copytext = selection + pagelink,
    newdiv = document.createElement('div');
    
    //hide the newly created container
    newdiv.style.position = 'absolute';
    newdiv.style.left = '-99999px';
    
    //insert the container, fill it with the extended text, and define the new selection
    document.body.appendChild(newdiv);
    newdiv.innerHTML = copytext;
    selection.selectAllChildren(newdiv);
    
    window.setTimeout(function () {
      document.body.removeChild(newdiv);
    }, 100);
  }
  document.addEventListener('copy', addLink);
</script>
  1. Save changes

Now that you have the code saved to your footer, every time someone tries to copy a text from your website, an addendum with a link to the original post will be added after the originally copied content.

While a person who has copied the text can still easily delete your addition in any text editor, at least you showed that you’re aware of the copied material. While the most people will simply delete that addition, you can hope that someone will leave a link to your site (intentionally or not) and therefore thank you for your work.

In Conclusion

Although a simple copyright notice might not stop people from copying your content, it is important that you have one. We hope that this article will be useful for you and you’ll can to protect your content.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!