• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Insert A Footer Into WordPress

Bhagwad Park

Published on: January 29, 2020

Categories: WordPress 0

I’d earlier written about different ways to remove the footer of a WordPress post or page. The exact solution you need might work for one setup, and fail on another. However, since then, I’ve received questions from some people asking how to insert a footer into WordPress.

Turns out the same method used to remove a footer need not be the same one use to insert it. As before, we want to find a solution that works across all themes and doesn’t get wiped out whenever someone updates a theme file. As such, my preference is to use a function in a custom code plugin to protect against this eventuality.

So here’s how to insert a footer into a WordPress theme.

Add the Code to Your Functions File

Turns out that you can add footer content to your page just by pasting a few lines into your custom PHP plugin or functions.php. Here it is:

function insert_footer_function() {
    echo '<p>Putting stuff into the footer area</p>';
}
add_action( 'wp_footer', 'insert_footer_function');

After you’ve saved your changes, you can see that the above line appears as shown here:

Inserting a Footer into WordPress

This is the TwentyTwenty theme from WordPress, and I haven’t removed the old footer. So you can see that the new one appears right at the very bottom of the page just before the <body> tag.

Styling the New Footer

One thing to note – the styling of the footer doesn’t match the styling of what the footer would have been. This is to be expected because most themes put the footer in a specific location that fits in with the overall look and feel of the site. So you can see in the screenshot above, the natural footer is indented or centered with the rest of the content, whereas the footer that we’ve just inserted just sits there unstyled.

Now of course, we can style it by putting in the appropriate HTML, but this will vary from website to website. However, one trick I’ve found, is that we can “cheat” by using the style that the previous footer had. We can do this by going to the browser’s development tools and highlighting the specific footer area to see the class of its container.

You can see from the screenshot below, that the class is “wrap”.

Get the Class of the Existing Footer

So now we can modify our code by giving our text the class “wrap” as shown here:

function insert_footer_function() {
    echo '&lt;p class="wrap"&gt;Putting stuff into the footer area&lt;/p&gt;';
}
add_action( 'wp_footer', 'insert_footer_function');

Modify this function based on the class that your theme has. And now after you save your code and reload the page, here is what you see:

Styling the New Footer

Now the footer is much more aligned, and likely fits into the framework of your site. From here, you can go further and start adding all the CSS classes that apply to your current footer. This way, it looks more natural, and less likely to stand out.

It’s that easy! Paradoxically, it seems that sometimes removing a footer can be much harder than adding a new one, since themes can make it hard to remove their own footers, but the process of creating a new one is standardized across all WordPress installations.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How to Eliminate Render-Blocking Resources in WordPress (& Why You Should)

Many things can slow down your site, including render-blocking resources. These are CSS and JavaScript files that delay the loading of content on your site. As a result, visitors will have to wait longer to interact with your page, which could lead to frustration and instant exits.  So, what can you do to eliminate render-blocking […]

How To Start A Newsletter In WordPress

Check out our complete guide on why and how you should start your own newsletter in WordPress.

Blogger vs. WordPress: Which One to Use?

Let's compare WordPress and Blogger across five key areas. Then, we'll show you how to set up a professional blog with WordPress.

What Is Self-Hosted WordPress?

In this post, we’ll differentiate self-hosted WordPress from WordPress.com, and discuss the benefits of the former.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA