Search optimization

Search Engine Optimization (SEO) is a best practice for web authors to help their webpages rank higher in searche engines. This increases your web content's visibility and helps your target audience be able to find the information they're looking for. SEO becomes increasingly important as more web users turn to Google first to find information vs. remembering campaign short URLs, using your site navigation or following link trails on your website.

Best practices - what you can do to improve SEO

Search engines, like Google, use algorithms to index and rank webpages across the internet and produce a list of search results based on they keywords users type into the search field. "Search algorithms look at many factors, including the words of your query, relevance and usability of pages, expertise of sources, and your location and settings. The weight applied to each factor varies depending on the nature of your query—for example, the freshness of the content plays a bigger role in answering queries about current news topics than it does about dictionary definitions" (from https://www.google.com/search/howsearchworks/algorithms/).

Pages on calgary.ca also tend to rank higher in searches from computers within the city of Calgary (geographic relation) and because it is a trusted/reliable source of information (government authority).

We can't always control how users search for information, but we can optimize our webpages to make them more Google friendly. Make sure you include the following best practices when creating and editing your webpages.


1. Keywords

Keywords play a big role in SEO because search engines rank pages based on how exactly the page content matches, and how relevant the page content is to the keywords a user types in the search bar. If those keywords appear on the page, or if they appear in the headings or body of the text, the information is more likely to be relevant and will result in a higher ranked search result. You want to think like a citizen — what words would they use to find the information they’re looking for? Use these keywords throughout your content page.

1.1 Search for keywords

You can use Google Search Console or Google Analytics to find out exactly what keywords people are using to find your existing webpages. This report is typically found under Acquisition > Search Console > Queries. Note: Google doesn't share its exact algorithms and keyword searches externally so we must use Google products for information about Google searches.

Search terms used in the calgary.ca search bar can also be found using Adobe Analytics.

1.2 Revise page content

Once you know the most common keywords used in search, you can update your page content to include exactly those search terms. Also consider any related terms and phrases users could be using to search for related sites or information. This will make your page rank higher in Google and other search engines.


2. Titles and headings

Similar to keywords, titles and headings should be descriptive and targeted to what users might be searching for. This not only helps search engines determine what information is important on a page, but also helps users quickly find the information they're looking for as they scan the page. Breaking up long content with titles and headings can make the overall page easier to understand, and helps visually-impaired users who use a screen reader jump to certain sections without having to listen to the entire page. See also Plain Language Policy/Writing for the Web.

2.1 Write a good title

  • Be concise, powerful and descriptive of what your page is about
  • Be unique to the page and clearly distinguished from pages with similar or related content (a user will have a hard time deciding which page to visit if multiple similarly titled pages are presented as search results)
  • Use three to five descriptive keywords that people are likely to search for
  • Use sentence case - only the first word and proper nouns are capitalized

2.2 Write good headings

  • Use three to five descriptive keywords that people are likely to search for (four to eight words in total)
  • Use sentence case — only the first word and proper nouns are capitalized
  • Put the most important words first
  • Accurately describe the content in the section (people may only be scanning subheadings to find what they need)
  • Use subheadings if your heading covers more than one topic
  • Use the correct heading levels in order (never skip levels e.g. h2 to h4, even if you think it looks better)
    • Heading 1 <h1> is for the title at the top of the page. This is the only time this heading is used.
    • Heading 2 <h2> is for subheadings within the page to break the content into chunks that can be easily scanned and consumed. Most pages will only use the <h2> level.
    • Heading 3 <h3> subheadings can go within those sections, then Heading 4 <h4> if needed. Only use lower levels for content within and related to a higher level.

2.3 Examples

  • Title: Aquatic & Fitness Centres – Swimming Pools
  • Headings: 
    • Swimming pool locations
    • What’s happening at our pools
    • Find swimming programs

3. URLs

URLs should be easy to understand, as users may use the URL to determine their place in the website. Search engines also look for readable words in a URL to determine the site's content. When creating a directory or page name, use words that are descriptive of the content. Note: page titles and URLs don't have to match. See also Content standards and best practices - URLs.

3.1 Use short URLs for campaigns

Content to be added

3.2 Format subdomains to include your home site

Subdomains are sites built outside of the calgary.ca infrastructure but we want to convey they are part of The City's web presence. The URLs are formatted like "liveandplay.calgary.ca" or "streetlightoutage.calgary.ca" because calgary.ca has a strong brand attached to it and will help rank higher in searches.

Dedicated URLs for City projects (e.g. www.MYPROJECTHERE.com) outside of calgary.ca are not permitted.


Search engines, like Google, use internal and external links on your webpages to help determine what your site is about from the related content.

4.1 Make sure links are relevant

The more you link to related content and webpages (internal and external), the more search engines understand what type of information can be found on your page. This helps match your page to the meaning of a user's particular search query.

However, too many links on a page can confuse and overwhelm users, making it difficult for them to get to the right place. Only link to content that a visitor to that page is likely to find useful (e.g. your related webpages). Avoid random links that aren't related to your content. Note: if you remove a link to a document on a page, the document can still show up in search unless you unpublish and delete it from your assets folder.

Make sure you choose good link text so users understand where they will go if they click on the link. Search engines also use the link text to determine the quality and relevance of the link. Avoid using link text like "click here" or "read more". See also Content standards and best practices - Links.

4.2 Check for broken links

Webpages with broken links tend to rank lower so you should make sure to check for and repair broken links often. Sometimes you can run regular automated broken link tests, but other times you need to manually click on the links on your page to make sure they're all going where you want them to.

4.3 Increase external links to your site

Webpages rank higher in search results the more reliable external links come into your website (e.g. from social media, partner sites, etc.). When people link to your content, it tells search engines that your webpages are useful.


5. Metadata tags

Metadata tags are the back-end coded data that add categories or searchable "tags" to each webpage. These tags aren't necessarily visible on a page, but are "crawlable" by Google bots and help Google understand more about the page and its contents.

  • Ensure that your <title> elements and Alt= attributes are descriptive, specific, and accurate. You may need to contact your Website Administrator or Development Team to change metadata tags.
  • Use other metadata tags to help Google understand the type of content that is on your page (e.g. article, recipe, event, etc.). This could help your content appear in a "content snippet" which is a prioritized listing in search engine results that highlights content and pages most closely related to a search inquiry. To learn more, see Google's documentation on content snippets.

6. Page speed (image/documentation optimization)

The more non-text content (e.g. images, documents, videos, code) you add to a page, the longer it can take for the page to load all of the data. Slower load speeds can make your webpage rank lower on search engine results because it creates a less desirable experience for users. You can use tools like Pingdom or Google's Page Speed Insights to test your page speed and see what elements could be optimized.

6.1 Resize and label your images

Images should be resized to the appropriate size for their use and saved specifically "for web" (In Photoshop, you can File > Export > Save for Web (Legacy)) before they're added to the web assets folder. The name of the image should be descriptive to help editors, users and search engines (e.g. "Swim-programs-kids.jpg" vs. "IMG000023.jpg"). Images should be 72 dpi for web and:

  • Thumbnails: 75 x 75 pixels (are these numbers still accurate?)
  • Small: Maximum width 160 pixels
  • Medium: Maximum width 305 pixels
  • Large: Maximum width 610 pixels

"Alt tags" are mandatory for all images. They not only help screen readers interpret the image for visually impaired users, but they help search engines determine what content exists on the page. Even if the image is decorative, you should include a blank alt tag (Alt="") or selecting the "image is decorative" option in AEM.

Avoid using images with embedded names, content or links; this should be text content so it can be read by screen readers and shows up in search engine results. Images that don't add any value to the page don't need an alt tag. E.g. If your page is about garbage collection, and there’s a picture of a random garbage bin to make the page look more interesting, that photo should not have alt text. See also Content standards and best practices - Images and Visual design accessibility.

6.2 Optimize your documents

Documents that contain images and other elements add to the overall size of the document and take longer to load. While links to documents do not add to page load time, documents that are loaded into a preview viewer will.

You can compress images in Word documents (Format > Compress pictures) before you save as a PDF, and save the PDF to be more compatible with older versions, which will reduce the file size. Be aware that compressing files can reduce the quality of the content in the document (e.g. images can become more pixelated). You should also avoid embedding other documents within a PDF. As a general rule, PDFs should be less than 5 MB (AEM will technically allow up to 4 GB, but documents of this size are not recommended).

Make sure you save PDF documents with descriptive names to help users know what information they'll find, and help search engines know what your content is about.

Some PDFs can be converted into webpage content to increase usability, accessibility and searchability. It is especially difficult for users to open and navigate a PDF on a mobile device because the text doesn't scale for the screen size; you have to zoom in and scroll around the page. Carefully consider what the purpose of the PDF is before adding it to your webpage. See also Content standards and best practices - PDF documents.

6.3 Keep embedded videos short

Videos that are set to auto-start on page load will add to the page speed once it starts playing. Also make sure the video file is available at a stable URL (server can handle the load) so the data won't have trouble loading. See also Content standards and best practices - Videos.


7. Usability on mobile and desktop

Websites that are designed to work well on all screen sizes rank higher in search engine results because it improves page load times and a user's experience. That being said, search engines like Google now prioritize mobile results over desktop results, so it's in your best interest to optimize your site for a good mobile experience.

7.1 Design for mobile first

Calgary.ca webpages should be designed for mobile devices first because metrics show a growing trend of users visiting the site on mobile devices vs. desktop computers. You should consider how layouts work on smaller screen sizes so:

  • Calls to action are easy to find
  • Text paragraphs don't become walls of text
  • Images don't take up more than the entire screen
  • Links and buttons are far enough apart that there's no difficulty accurately tapping on the correct link

Avoid using pop-ups that take up the full screen, compel users to click on them or hide the background text. See also Responsive web and Semrush's Beginner's Guide to Mobile SEO.

7.2 Test different browsers

Different browsers interpret and display websites with slight differences (e.g. different spacing, different page widths, etc.). Since users could have any browser, it's better to make sure your site appears correctly in at least the most popular browsers (e.g. Chrome, Safari, Explorer/Edge, Firefox, etc.).


8. Recent updates

Information that isn't updated regularly tends to get stale/outdated very quickly. Pages that have recent updates tend to rank higher in search engine results because the content is likely more relevant.

8.1 Schedule regular content reviews and updates

Regular content reviews can help you identify areas of your web content that may not be performing how you want it to. You should routinely look at and proactively maintain:

  • What keywords are people using to find your page/site
  • How many people are coming to your site
  • What is driving traffic to your site (e.g. campaigns, seasonal promotions, social media, etc.)
  • What tasks are they looking for or completing on your site
  • Is the information still relevant or have your processes changed
  • Do you need to remove old events or dates
  • Have any of your links broken since you last checked
  • Are the photos outdated
  • Are linked documents still relevant and up to date
  • Are there any orphaned documents in your assets folder that need to be deleted
  • Does your page load within an acceptable time
  • Does the page still need to exist — e.g. if it's for a program that ended, consider whether there is information that citizens still need to reference
  • If you need to keep a page for a completed program, is the page clear that the program is over