Installation

  1. Log into your Confluence instance as an admin.
  2. Click the admin dropdown and choose Atlassian Marketplace.The Manage add-ons screen loads.
  3. Click Find new add-ons from the left-hand side of the page.
  4. Locate TechTime EasySEO via search.The appropriate add-on version appears in the search results.
  5. Click Try free to begin a new trial or Buy now to purchase a license for TechTime EasySEO.You're prompted to log into MyAtlassian. TechTime EasySEO begins to download.
  6. Enter your information and click Generate license when redirected to MyAtlassian.
  7. Click Apply license.If you're using an older version of UPM, you can copy and paste the license into your Confluence instance.

How to Enable EasySEO

EasySEO Plugin for Atlassian Confluence

This plugin allows enhancing your Confluence pages with common SEO attributes like meta keywords and meta description tags as well as gives you more control over the titles of your pages.

Once you have installed the extension you can apply it to the main decorator of any space that uses default Confluence theme or embed in your own theme decorators.

ENABLE EASYSEO

To enable EasySEO features insert the following code in your "main" decorator in the HTML head section. Remove any default code associated with HTML title.

The "main decorator" is located under SpaceTools > Layouts > Main Layout

$seoHelper.renderFullSimple($sitemeshPage,"{2} - {3}")

i.e. for the latest default theme replace

#if ($sitemeshPage.getProperty("page.spacename"))
        <title>$title - $sitemeshPage.getProperty("page.spacename") - #siteTitle()</title>
    #else
        <title>$title - #siteTitle()</title>
    #end

with

$seoHelper.renderFullSimple($sitemeshPage,"{2} - {3}")

This will render title, meta date (modified), meta author and meta keywords tags.

Enable EasySEO for each Space

EasySEO is disabled by default for each space. So it is recommended to enable the plugin only for public facing spaces.

You can access the per space configuration under:

SpaceTools > Apps > EasySEO

You can then enable the meta tags that you would like.


The title will be based on Space Description and Page/Blog Title.

If you need to insert meta tags individually the code is a bit more complex

#set ($contentid=$sitemeshPage.getProperty("page.pageId"))
## USE CODE BELOW FOR CONFLUENCE 5.2 AND ABOVE
#if ($action)
#set ($user = $action.getAuthenticatedUser())
#if ($user)
#set($username = $user.getName())
#else
#set ($username = "")
#end
#else
#set ($username = "")
#end
## USE CODE BELOW FOR CONFLUENCE BEFORE 5.2
##if ($action)
##set ($username = $action.getRemoteUser().getName())
##else
##set ($username = "")
##end
# USE CODE BELOW FOR ALL VERSIONS OF CONFLUENCE AFTER 5.0
#if ($contentid)
$seoHelper.renderTitle($spaceKey, $contentid, $username, "{0} {1} {2} {3} {4}", false, 100)
$seoHelper.renderMetaKeywords($contentid, $username, false)
$seoHelper.renderMetaAuthor($contentid, $username, false)
$seoHelper.renderMetaDescription($contentid, $username, false, 255)
$seoHelper.renderMetaDate($contentid, $username, false)
#elseif ($spaceKey)
$seoHelper.renderTitleSpace($spaceKey, $username, "{2} - {3}", false, 100)
$seoHelper.renderMetaKeywordsSpace($spaceKey, $username, false)
$seoHelper.renderMetaAuthorSpace($spaceKey, $username, false)
$seoHelper.renderMetaDescriptionSpace($spaceKey, $username, false, 255)
$seoHelper.renderMetaDateSpace($spaceKey, $username, false)
#else
    #if ($sitemeshPage.getProperty("page.spacename"))
       <title>$title - $sitemeshPage.getProperty("page.spacename") - #siteTitle()</title>
    #else
        <title>$title - #siteTitle()</title>
    #end
#end

FORMAT OF THE TITLE

The format of the title is defined using the following "variables" in the 4th parameter to "renderTitle":

variable
value
{0}space key
{1}space name
{2}space description
{3}page/blog title
{4}page/blog version comment

The list of keywords is assembled automatically from the labels on the page of blogpost. Labels with underscores are omitted.

The author is retrieved from creator of the content entity in question.

The description is generated automatically from {excerpt} macro or if not present from the page summary produced by the build-in Confluence summarizer if requested.

The date is the last modification date for the content entity (page, blog post) being displayed.

The last parameter in all calls is isXHTML flag - to produce valid "closed" XHTML tags.

ADDITIONAL METHODS

There is also a 4 and 5 argument form for meta description renderer

## 4th parameter indicates if description is required or should only be produced if 
## {excerpt} macro is present on the page
$seoHelper.renderMetaDescription($contentid, $username, false, true)

## 5th parameter indicates if new method to produce excerpts should be used if
## {excerpt} macro is NOT present on the page
$seoHelper.renderMetaDescription($contentid, $username, false, true, true)

All methods that have "contentid" as a parameter have counterparts that require the space key only and use the home page for this space as the content entity:

$seoHelper.renderTitleSpace($spaceKey, $username, "{0} {1} {2} {3} {4}", false)
$seoHelper.renderMetaKeywordsSpace($spaceKey, $username, false)
$seoHelper.renderMetaAuthorSpace($spaceKey, $username, false)
$seoHelper.renderMetaDescriptionSpace($spaceKey, $username, false)
$seoHelper.renderMetaDescriptionSpace($spaceKey, $username, false, false)
$seoHelper.renderMetaDescriptionSpace($spaceKey, $username, false, true, true)
$seoHelper.renderMetaDateSpace($spaceKey, $username, false)