All you need to know about links, slugs and URLs in P4. How they are formed, how to customize them and even redirect
What are URLs, slugs and (perma)links
Sometimes they are confused, but URL (Uniform Resource Locator), slug and link are 3 different things:
- The URL is the address that specifies the location of a resource on the Internet
- this is a URL >> https://planet4.greenpeace.org/implement/faqs/
- The slug is the part of a post or page’s URL that identifies that particular section of the site
- this is the slug >> https://planet4.greenpeace.org/implement/
- The Hyperlink (or simply the link) is an element in an electronic document that links to another place in the same document or to an entirely different document.
- The Permalink is a URL that is intended to remain unchanged for many years into the future
- this is a permalink >> https://planet4.greenpeace.org/
And UTMs? Nothing to do with Planet 4, but more with Analytics. Check this awesome video for UTMs.
The P4 links settings
In the Admin mode, go to Settings > Permalinks and select “Custom structure”.
KEY INFOS >>
1) To ensure consistency across P4 sites, the POST permalinks basic settings should follow the Custom Structure: /%p4_page_type%/%post_id%/%postname%/ 2) If you change this structure, all existing links will be updated and redirected, given that the %post_id% is kept! |
Posts URLs
With these settings, each time a post is created, it will get assigned a automatic URL, which follows this structure:
- Domain /
- site path (usually NRO)/
- Post Page type / (Press, Publication, Story)
- Post ID / (generated automatically)
- Post title / (can be manually edited)
Posts can’t get the full URL edited, but only the final part (= post title), which automatically replaces spaces with “-“.
Pages URLs and “Parenting”
Pages get URLs generated in a different way, since we can modify the way pages get organized using URLs.
Let’s see the Energy page, for example, which we want to be under “Issues”.
In the Edit mode we can edit the last part (title), exactly like in POSTS (see snapshot below)
We can, however, attribute a Parent page, which URL will appear before the page title.
This can be done in Edit Mode, on the right side, in “Page Attributes”. The dropdown will show you all the existing pages, but you can select only one.
By customizing the “parenting” page, here’s what our URL looks like:
- Domain /
- Site path (usually NRO)/
- Category or Parent Page / (Press, Publication, Story)
- Page title / (can be manually edited)
The “Parenting” relations can be accessed in Admin Menu > All Pages
#Tag pages url
In Settings > Permalinks you can customize your Tag pages url, to change from /tag/xxx to /whatever/xxx
Insert links in P4 Content
Pretty easy, use the link icon in the WYSIWYG editor (see below)
Whether you insert URLs in post / page edit mode or by customizing buttons in Blocks, there is NO NEED to use act.gp (or any link shortener) in P4 content, mostly because the cross-domain tracking in Google Tag Manager does not pick up shortened URLs.
KEY INFO >> shortened URLs (act.gp or others) will not be tracked in Google Analytics account, therefore P4 pages with those will have corrupted traffic data!
So, NO short URLs (and if possible, no UTM) in P4 content, just the regular petition / external link/s ! |
For ex.: in the beautiful – https://www.greenpeace.org/international/act/ the “TAKE ACTION” button had http://act.gp/2CUGEEI – and was not tracked properly.
Replacing the shortened URL with the regular petition url – https://act.greenpeace.org/page/18001/petition/1 – allows to track conversions coming from Planet 4.
Map, create and manage redirects
P4 redirects
P4 redirects are managed by a wordpress.com Plugin called redirection.me.
KEY INFO >> before going live, all migrated URLs should be mapped out to understand and set up redirects |
As a LAST exercise of the Deployment phase, you should extract all the URLs of your Planet 4 site and map them down in a Google Sheet. This is useful for 2 reasons:
- Perform a very last quality check if all content has been migrated correctly
- Identify internal redirects to be implemented
To setup a redirect, in the P4 Admin dashboard, go to the left side menu and click on Tools – > Redirection
Go to the Add new redirection at the end of the page, insert the URL (or regex) you want to redirect/ the short URL in the Source URL field and the destination one/ where you want to send the traffic in the Target URL field, then click on Add Redirect. The new redirect should appear in the list above.
You can also add “Regex” (aka – regular expression, matching many RLS). To apply regex redirects , you must insert (.*) in the Source URL and /$1 at the end of the target URL
In the example above we are redirecting everything with url construct starting with /international/global/ to the archived domain.
P3 redirects
After P3 is archived and before is permanently decommissioned, it`s possible the web administrator would want to set redirects for some P3 pages directly to P4.
The best solution is to set redirects on page redirects. Here are the steps:
- login to Planet 3
- select the page you want to set the redirect for and click Edit
- select Shortcut/ External Link from the top bar
- In the Link Type field, select Link to page on another Web site
- Add the URL from P4 site in the External link field
- Click on Save and Publish
Templates & links
- Handbook Articles
- Create posts
- Create Take Action Pages
- Navigation and pages
- Setup the P4 Settings
- Setup the P4 Content (Navigation, Footer, Menus and Favicon)
- Templates / Examples
- Template – redirection & url mapping file (Public)
- GP Greece Redirection & url mapping file (Accessible to GP Staff only)
- GP New Zealand Redirection & url mapping file (Accessible to GP Staff only)
- GPI redirection list – https://github.com/greenpeace/planet4-gpi-redirects