Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Add Signature or Ads after Post Content in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add Signature or Ads after Post Content in WordPress

Recently one of our users asked on our facebook page, how to add signature after post content in WordPress. There are a lot of ways you can do this, but we will share the most efficient method that will work for almost all themes. In this article, we will show you how to add signature or ads after single post content in WordPress.

All you have to do is add the following code in your theme’s functions.php file or in a site-specific plugin.

//Add Signature Link
function custom_content_after_post($content){
if (is_single()) {	
	$content .= '<p>Load Your Content Here</p><img src="'. get_template_directory() .'/images/signature.png" alt="Your Name" />';
	return $content;

add_filter( "the_content", "custom_content_after_post" );

All you have to do is change the code after the = sign. You can use it to place an image like we did above. You can use it to add ads. This is by far the simplest way of doing so which will work in parent themes as well as child themes of popular frameworks like Genesis, Thesis etc.

Note: if you are using a child theme, and your image is stored in your child theme’s images folder then replace get_template_directory with get_stylesheet_directory.

If you don’t like to code, then you can use one of the many plugins that are available such as FT Signature Manager or WordPress Signature.

Lastly, if you were wondering how to add ads within post content (such as after the first paragraph of your post), then check out our article on how to insert ads within WordPress post content.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. David says:

    What if I want to add to a particular category ?

  2. John says:

    Many thanks for this excellent tutorial!
    How to EXCLUDE some custom post types?

  3. Blogland says:

    Hi, just question…for a very early beginer…;) Where exactly do I add the code? when I open the function editor I see a lot of code an I do not know where I have to paste it.
    Just other question, I would like to put something like ” subscribe to us, is more confortable to rececive the news by email” ( and add an emoticon I have with a plug in). Can I do it adding the text+emoticon simply?
    Thank you very much, I love this page!

  4. Derek Dirks says:

    What if you wanted this to only show in a certain directory? For example, we have a Q&A section that we would like to occasionally include promotions to books, seminars, etc. Can this function be changed so that it will only add the signature if it is for a path such as

  5. Ahmad Awais says:

    Nice artilce, but the thing is when we add it this way and using some other plugins, who are also taking part in this filter to add content after content, how to order those content filters.How to make the one you are adding stand first in priority than others.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.