Title: Copyright plugin?
Last modified: August 18, 2016

---

# Copyright plugin?

 *  [gvtexas](https://wordpress.org/support/users/gvtexas/)
 * (@gvtexas)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/)
 * MT has a nifty plugin that reads the date of one’s first and last post and creates
   a copyright span, e.g., (c)2001-2004 – automatically via an MT tag.
    Are there
   any plugins for WP that will provide the same function? Gary

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-103997)
 * Not that I’ve seen, and it doesn’t really matter anyway:
    10 Big Myths about 
   copyright explained [http://www.templetons.com/brad/copymyths.html](http://www.templetons.com/brad/copymyths.html)
 *  [planetthoughtful](https://wordpress.org/support/users/planetthoughtful/)
 * (@planetthoughtful)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-103998)
 * Hi gvtexas,
    Wouldn’t be hard to write one. Give me a few minutes and I’ll see
   what I can put together. Much warmth, planetthoughtful
 *  [planetthoughtful](https://wordpress.org/support/users/planetthoughtful/)
 * (@planetthoughtful)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-103999)
 * [@gvtexas](https://wordpress.org/support/users/gvtexas/)
    podz’ insightful comment
   notwishstanding, if you still wish to display this information, the following
   plugin might do the trick. Save the following into a file called copyrightspan.
   php in your /wp-content/plugins/ folder. `<?php /* Plugin Name: Display Copyright
   Span Plugin URI: http://wordpress.org/# Description: This plugin displays a copyright
   notice including the year of the first and last post Author: planetthoughtful
   Author URI: http://www.planetthoughtful.org */ function display_copyright_span(){
   global $wpdb; $pretext = "Copyright &copy; myname "; $postext = ""; $firstdate
   = $wpdb->get_var("SELECT UNIX_TIMESTAMP(MIN(post_date)) FROM wp_posts"); $lastdate
   = $wpdb->get_var("SELECT UNIX_TIMESTAMP(MAX(post_date)) FROM wp_posts"); echo
   $pretext.date("Y", $firstdate)."-".date("Y",$lastdate).$postext; } ?> Edit the
   values in $pretext (and optionally $postext, if you have text you wish to appear
   after the year range) and save. Activate the plugin and then in your index.php
   file, include the following where you want to display your copyright notice: 
   <?php display_copyright_span(); ?> And that’s it. Let me know if you experience
   any problems with it. Much warmth, planetthoughtful
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104012)
 * You could also just add the copyright info into your footer via editing index.
   php .
 *  [dkaye315](https://wordpress.org/support/users/dkaye315/)
 * (@dkaye315)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104026)
 * i built a quicktag to use for posting purposes – one for the image style, and
   one for the text string and format:
    `<img style="padding: 12px; border: 1px 
   solid #222; background-color: #fff;" src="xxx" alt="xxx" />` `<span style=" font:
   italic .8em verdana, sans-serif; color:#666">(from the [xxx collection](https://wordpress.org/support/topic/copyright-plugin/"xxx"?output_format=md)&
   copy; 2004 dkaye.com)</span>` for each post, i simply fill in the “xxx”. for 
   the page itself, i have an overall copyright disclaimer in the footer section.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104028)
 * Hey, can I pile on the copyright bandwagon?!
    I wanted just a simple copyright
   notice to provide a range of years (first post year-current year), or the correct
   year when I’m on a single entry or archive page: ` Copyright © <?php if ($m) {
   echo substr($m, 0, 4); } else if ($year) { echo substr($year, 0, 4); } else if(
   $single) { echo substr($post->post_date, 0, 4); } else { echo "2002-".date('Y');}?
   > Me me me!
 *  [planetthoughtful](https://wordpress.org/support/users/planetthoughtful/)
 * (@planetthoughtful)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104108)
 * [@gvtexas](https://wordpress.org/support/users/gvtexas/)
    Hmmm. These other index
   pages, are they serving WP content, or ‘outside’ the WP application? I ask, because
   it seems like they’re not including activated plugins, which sounds like they’re
   agnostic to any plugins you’ve installed for WP, including the one I wrote for
   you above. Are any other plugins working as expected on these pages? It wouldn’t
   be difficult to tweak the plugin so you could explicitly include it in the pages
   that aren’t behaving properly (see below), though if the pages are not seeing
   installed plugins, I’m wondering if they can also see the preferred $wpdb database
   class, which I’ve made use of in the plugin. I’m going to assume that these pages
   _can’t_ see the $wpdb class, so you’re going to have to edit some variables in
   this version to allow the plugin to access your database via PHP’s mysql extensions.`
   <?php /* Plugin Name: Display Copyright Span Plugin URI: http://wordpress.org/#
   Description: This plugin displays a copyright notice including the year of the
   first and last post Author: planetthoughtful Author URI: http://www.planetthoughtful.
   org */ function display_copyright_span(){ $host = 'localhost'; // Should be okay
   to leave as is, but just in case $dbname = 'mydb'; // Edit for applicable db 
   name $dbuser = 'myuser'; // Edit for applicable db user $dbuserpass = 'myuserpassword';//
   Edit for applicable db user password $pretext = "Copyright &copy; myname "; $
   postext = "";
 *  @$db = mysql_pconnect("$host", "$dbuser", "$dbuserpass")
    or die("Error connecting
   to database with the following error message: ".mysql_error()); mysql_select_db("
   $dbname"); $fsql = "SELECT UNIX_TIMESTAMP(MIN(post_date)) as postdate FROM wp_posts";
   $fres = mysql_query($fsql); $fdat = mysql_fetch_object($fres); mysql_free_result(
   $fres); $lsql = "SELECT UNIX_TIMESTAMP(MAX(post_date)) as postdate FROM wp_posts";
   $lres = mysql_query($lsql); $ldat = mysql_fetch_object($lres); mysql_free_result(
   $lres); echo $pretext.date("Y", $fdat->postdate)."-".date("Y",$ldat->postdate).
   $postext; } ?> Save the above in the same place you saved the last version of
   the plugin (see my the post for the original version above). Edit the $dbname,
   $dbuser and $dbuserpass variables to suit your database. Change the $pretext 
   variable and optionally the $posttext variable (you’ll have to fix the ‘&copy;’
   again — this is converted by the WP forum and I don’t know how to stop it from
   doing this). It should behave as it did before on your WP index page. On the 
   other pages, include the following at or near the top of the page: `<php include_once('../
   wp-content/plugins/copyrightspan.php'); ?>` You may have to edit the path to 
   the plugin in the line above, depending on exactly where your index pages are
   stored in your directory structure. Once this is done, the call to the plugin
   should work in these pages as it does in your WP index page. Let me know if this
   fixes or does not fix the problem. Much warmth, planetthoughtful
 *  Thread Starter [gvtexas](https://wordpress.org/support/users/gvtexas/)
 * (@gvtexas)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104116)
 * Thanks for the rework, planetthoughtful.
    I first tested your new fix by itself
   and verified that it was reading mysql directly. But when I then tried to use
   the include for the footer on the pages that aren’t in the wp root, I received
   the same error again. The extra index pages are similar WP pages to the main 
   one…they just handle post data differently (and I was too lazy to dig into how
   to pull what I wanted off within one template!). I’m using the GetCustom plugin
   on all pages and that works fine, but it’s not in an include on these other pages.
   Your activation code also works fine on these other pages, so long as I don’t
   include it in an include. That made me think I was perhaps calling the include
   incorrectly…and bingo. I had used std. url to include the footer.php instead 
   of using the server path (as I had for other includes). That fixed the fatal 
   error, whether using your original code or the direct-mysql code. So…my bad! 
   on this one…. Thanks for running this down though (and ultimately enabling me
   to find my syntax oops….). At least there’s now *two* ways to create a copyright
   statement! Cheers, Gary
 *  [planetthoughtful](https://wordpress.org/support/users/planetthoughtful/)
 * (@planetthoughtful)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104149)
 * [@gvtexas](https://wordpress.org/support/users/gvtexas/)
    My pleasure, Gary. 
   Nice to be able to help. Much warmth, planetthoughtful
 *  [sskhalsa](https://wordpress.org/support/users/sskhalsa/)
 * (@sskhalsa)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104257)
 * why do u just do it manually in the footer, its not that hard. people are lazy:
   p
 *  [witchwife](https://wordpress.org/support/users/witchwife/)
 * (@witchwife)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104267)
 * You can just put the following code anywhere you want the copyright to appear(
   I suggest the footer) and it will always state the current year.
    Copyright ©
   <?php echo date(“Y”) ;?> Your Name
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104268)
 * For maximum browser compatibility, enter `&copy;` for the copyright symbol, rather
   than your font’s copyright symbol.
 *  [vaamyob](https://wordpress.org/support/users/vaamyob/)
 * (@vaamyob)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104269)
 * > why do u just do it manually in the footer, its not that hard. people are lazy:
   > p
 * For the same reason you use wordpress instead of notepad. :p
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104270)
 * Or for an older blog:)
    `Copyright Â© 1910-<?php echo date("Y") ;?> Your Name`
 *  [estjohn](https://wordpress.org/support/users/estjohn/)
 * (@estjohn)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104271)
 * there is also a creative commens for copyright plugin..
 * [http://firasd.org/studio/wp/wp-cc/](http://firasd.org/studio/wp/wp-cc/)

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Copyright plugin?’ is closed to new replies.

 * 15 replies
 * 11 participants
 * Last reply from: [estjohn](https://wordpress.org/support/users/estjohn/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/copyright-plugin/#post-104271)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
