Today, we are going to learn how to add an extra panel to the admin homepage in Wagtail. This small post shows how to a add a panel with a couple of links on the admin homepage.

We first start with creating a file called in one of our apps. In my demo, I've added it to the app called base. If you already have such a file, you just need to add the code in there.


from wagtail.core import hooks
from django.template.loader import render_to_string

class ExternalLinksPanel:
    name = 'external_links'
    order = 200

    def __init__(self, request):
        self.request = request
        self.external_links = [
            ('Google Analytics', ''),
            ('Google Search Console', ''),
            ('View Site', '/'),

    def render(self):
        return render_to_string('wagtailadmin/home/external_links.html', {
            'external_links': self.external_links,
        }, request=self.request)

def add_org_moderation_panel(request, panels):

We start with creating a class called ExternalLinksPanel which takes a request object in the constructor. It also implements the render method which performs the rendering.

We then register a hook called construct_homepage_panels which is triggered when Wagtail creates the admin homepage panel. We simply add our custom panel to the list.

To finish off, we also need to create the template which is in the render method. Pay attention to the location where we store this template because it will be loaded from the wagtailadmin application…


<section class="object collapsible">
    <h2 class="title-wrapper">External Links</h2>
    <div class="object-layout">
        <table class="listing listing-page">
            <col />
                    <th class="title">Link</th>
                {% for link in external_links %}
                        <td class="title" valign="top">
                            ➡️ <a href="{{ link.1 }}">{{ link.0 }}</a></br>
                {% endfor %}

Then restart your server and you should see the panel appear on the homepage.

Related Posts

  • Defining custom settings in Wagtail
  • Making publish the default action in Wagtail
  • Migrating your Wagtail site to a different database engine
  • Programatically creating redirects in Wagtail
  • Change the Wagtail site domain via a management command