How to Add a Signature to Your WordPress Posts

Adding a signature to your WordPress posts is one way to give your blog a more personal touch. The code below will automatically include your signature after the content of your blog posts so that you don’t have to manually add it every time. Here’s an example result:

Copy this code and paste it into your functions.php file:

function add_signature($text) {
global $post;
if($post->post_type == 'post') $text .= '<div class="signature">
<img src="http:/" alt="signature" />
return $text;

Make sure to change the image URL to the location of your image, or you can replace the image tag with plain text.

Tweak via CSS as needed…

If you have any issues with the placement or appearance of your signature, you can style it with CSS. For example:

div.signature img {
padding: 5px;

The best part is that there’s no need to add a new plugin to accomplish this. Simply copy and paste and your signature will be automatically included. Update the image any time you like and it will be dynamically changed on all posts on your blog.


Comments (18)

  1. Hi Sarah,

    This is a cool tip! I’ve always done it manually with an image. Good to know I can add it to my code. Hmmm… I wonder how it’s going to work out when I have a guest poster on my site??? I guess no way of taking it out for individual posts huh?

    Thanks again! :-)

  2. This is a great tip, and I am using it on my site. The problem I’m having is that it squishes my signature and it doesn’t look as good as it does in Photoshop. Is there another line I can put in the code to make sure it retains it’s original width? I tried adding width=”288px” but that didn’t help.


  3. Hi Sarah! Loved your tip, it worked perfectly, but I’d like to know if there’s a way to edit this code so my signature appears only on the post page. I have excerpts on the main page and I don’t want to show up my signature below it. Hope you can help me! Thank you!