Your website is your reflection to the online world.  It’s responsible for the impression you want to give your audience. Some common mistakes can ruin your persona.  An outdated copyright date is one of the common mistakes that most of the webmasters do.

An outdated copyright date or an expired offering calls all the information on a website into question as to its correctness.

Dynamic copyright year

4 ways to Add a Dynamic Copyright Date

  1. Simple PHP method

    This is the simplest method for showing dynamic copyright date in your website. Just put this code in your PHP file and show the current year in your website.

    Copyright <?php echo date('Y'); ?> My Company.
  2. JavaScript Method

    This is an another simplest method for showing dynamic copyright date in your website. Just use this JavaScript code and show the current year in your website.

    var theYear = document.createElement( 'div' );
    theYear.classList.add( 'the-year' );
    theYear.textContent = 'Copyright ' + new Date().getFullYear() + ' My Company.';
    document.body.appendChild( theYear );

    Source: GitHub

  3. From Year to current Year

    If you want something more elaborate that will take the year of the earliest post you have to the latest post you have, you can do this by adding the following function in your functions.php file.

    function smallenvelop_copyright() {
    global $wpdb;
    $copyright_dates = $wpdb->get_results("
    YEAR(min(post_date_gmt)) AS firstdate,
    YEAR(max(post_date_gmt)) AS lastdate
    post_status = 'publish'
    $output = '';
    if($copyright_dates) {
    $copyright = "&copy; " . $copyright_dates[0]->firstdate;
    if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
    $copyright .= '-' . $copyright_dates[0]->lastdate;
    $output = $copyright;
    return $output;

    Then open your theme’s footer.php file and add the following code where you want to display the date:

    <?php echo smallenvelop_copyright(); ?>

    Source: wpmudev

  4. With the help of  Plugins

    If you don’t want to deal with the codes, here is the next solution for you. WordPress repository has many plugins for displaying dynamic copyright date in your website.  Here I am listing some of the WordPress plugins that can help you.

    1.  Current Year and Copyright Shortcodes
    2. Auto Copyright
    3. Dynamic Dates
    4. Copyright Shortcodes