GGDS for WordPress
Many government websites run on WordPress. GGDS gives them the same official banner, clear header and footer, readable pages and fast loading as every other GGDS website, without rebuilding anything.
Switch an existing website
Most government WordPress websites were built with a heavy theme and a page builder, such as Elementor, WPBakery or Divi. Those make pages slow on a phone, hard to read and hard to keep accessible. GGDS Switch is a plugin that moves the website to GGDS in one go, and keeps everything that matters.
-
Back up and install
Back up the website first: your host's backup or a backup plugin. Then download
ggds-switch-0.5.0.zipand upload it in Plugins > Add New Plugin > Upload Plugin. The GGDS theme is inside it. -
Tidy up first
GGDS > Tidy up content finds the placeholder pages and sample text that should not come with you, such as "Hello world!". What it finds.
-
See what it found
Activating the plugin opens GGDS > Switch to GGDS. It lists your theme, the pages made with a page builder, pages with their own colours, your logo, homepage, widgets, comments, and plugins to check. Nothing changes yet.
-
Check your details and menus
Your short name, official address, colour, email and phone are filled in from your website, and your menus are matched to GGDS's places. Check each one. Made your website in the website builder? Fill in from the file takes them from its
ggds-site.json. -
Preview
See the whole website with GGDS, every page cleaned, before anyone else does.
-
Switch, then check
Press Switch to GGDS. The screen then lists what to do next, and each page to look at with what to check.
Good to know: You can undo it
Undo the switch, on the same screen, puts back your old theme and every page exactly as it was. Keep your page builder installed until you are happy with your pages, then deactivate it.
What happens to your pages
The switch looks at each page as visitors see it, keeps what carries meaning and takes away what made it heavy.
| Kept | Taken away |
|---|---|
| Headings, put in order under the page title | Page-builder rows, columns and boxes |
| Paragraphs, lists, bold and links | Colours, fonts and sizes set on the page, so every page keeps its contrast |
| Images, with their real address when they were loading late | Scripts, which slow pages down and break a strict security policy |
| Tables, quotes and embedded videos | Sliders and forms made by the page builder: each one is listed, so you can put it back the right way |
| Other plugins' shortcodes, such as a contact form's | Icons used as decoration |
Your homepage becomes the GGDS homepage: your question, a search box, your common tasks and your main sections. The old homepage layout is kept as a draft page, so you can reuse its words.
[vc_row][vc_column][vc_column_text]
<h1 style="color:red">About the Authority</h1>
<p><span style="font-size:18px"><font color="#333">We regulate
<b>example</b> communications.</font></span></p>
<p> </p>[vc_icon]
[/vc_column_text][/vc_column][/vc_row]<h2>About the Authority</h2>
<p>We regulate <strong>example</strong> communications.</p><>
<h2>About the Authority</h2>
<p>We regulate <strong>example</strong> communications.</p>
</>Page builders it understands
Elementor, WPBakery, Divi, Beaver Builder, Avada, SiteOrigin, Oxygen and Brizy. While the builder is still installed, the switch uses the builder's own output, so nothing is guessed. If the builder has already been removed, its leftover codes (such as [et_pb_text]) are unwrapped, keeping their text, images and buttons.
Tidy up placeholder content
Websites often still carry text that was only ever meant as an example. Visitors find it in search, and it makes a government website look unfinished. GGDS > Tidy up content, part of GGDS Switch, finds it on any WordPress website, switched or not. Do it before you switch, so none of it comes with you.
It looks for:
- lorem ipsum and other sample text;
- WordPress's own examples: the "Hello world!" post, the "Sample Page", the example comment, and the tagline "Just another WordPress site";
- a theme's demonstration pages, such as "Home Version 4" or "Blog Grid", and page builders' example text;
- published pages with nothing on them, or with only headings;
- sample text in sidebar widgets;
- pages with no title, and "coming soon" pages. These are only marked "to check", for a person to decide.
For each one it says why, quoting the words it found, and where the page is used. You choose what to do: Unpublish (keep it as a draft), Move to the Bin, Clear (for the tagline) or Leave it. The safe choice is made for you, and your homepage and news page always stay. One button applies your choices.
Good to know: Nothing is deleted for good
Undo is in the message straight afterwards, and in "Recent changes". Pages moved to the Bin stay in WordPress's own Bin for 30 days, or until someone empties it. Anyone who follows an old link to a removed page is told it has gone (410 Gone), so search engines drop it.
Start a new website
Quickest: make your website first. Choose your kind of institution, write your services and pages, then choose On WordPress. You get your pages, news and menus as a WordPress import, and these steps with your own details in them.
-
Install the theme
Download
ggds-wordpress-0.5.0.zipfrom the latest release. In WordPress: Appearance > Themes > Add New Theme > Upload Theme, then Activate. -
Add your institution
Settings > General: your full name as the site title, and what you do in one sentence as the tagline. Appearance > Customise > GGDS: your short name, colour, official address and contact details. Site identity: your approved logo.
-
Make four menus
In Appearance > Menus: see the table below.
-
Set your homepage
Settings > Reading: a static homepage, and a page for news.
| Menu place | What goes in it |
|---|---|
| Main sections | 3 to 6 main sections. They show in the header, as cards on the homepage, and the first three in the tab bar on phones. |
| Common tasks | Up to 6 things people most often come to do, such as "Make a complaint". They show under the homepage search. |
| Footer sections | Each section, with up to five of its most-used pages under it. |
| Footer links | Accessibility, Privacy, Disclaimer and Contact. |
Writing pages
- A page shows its breadcrumbs, title, its excerpt as an introduction, its content, then cards for the pages under it.
- Posts are news and notices: their first category shows as a tag, with the date.
- Use headings in order (Heading 2, then Heading 3), and link text that makes sense on its own. See Get started as a content designer.
- Colours, font sizes and gradients are switched off in the editor. GGDS sets them, so every page keeps its contrast.
Safe and fast by design
- Accessible: every page the theme makes, and every page the switch cleans, passes the automated WCAG 2.2 AA checks (axe) in a real WordPress, at desktop and phone widths.
- Secure: the public pages have no inline scripts or styles, so they run under a strict Content Security Policy. Comments are off, and WordPress does not announce its version.
- Official: the banner says the website is official only when it is served from the official address you set. On a test server it says "This copy is not the official website".
- Light: about 40 KB of styles and 4 KB of script, served from your own website. No fonts or other files to download.
Serve the public pages with a strict policy, for example in your web server. The admin area (/wp-admin/) needs a looser one, because WordPress's editor uses inline scripts.
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'self'Questions
Do I need a developer?
No. Installing the theme or the plugin, the switch and the undo are all done from WordPress's own screens. A developer or your host helps with the security policy and with backups.
Will my page builder still work?
After the switch, your pages no longer use it: they are plain content in WordPress's editor. Keep it installed until you are happy, in case you want to undo, then deactivate it. Your pages stay as they are.
What about my contact form, events or other plugins?
Shortcodes from other plugins are left in place, so they keep working. Some plugins add inline scripts or styles, which a strict security policy blocks: the switch lists the ones to check.
What happens to my sidebars, widgets and comments?
GGDS has no sidebars and no comments. Both are kept in WordPress but not shown. Put anything people need into your pages, and take feedback through a contact form that someone answers.
Can I change things after the switch?
Yes. Your details are in Appearance > Customise > GGDS, your menus in Appearance > Menus, and your pages in the editor as usual. But undo puts every page back as it was before the switch, so changes you made to those pages since are lost.
Which versions of WordPress does it work with?
WordPress 6.5 or later, with PHP 8.1 or later. It is tested with WordPress 6.8.
For developers and IT teams
Switch many websites the same way from WP-CLI. Details and menus you do not give are the scan's proposal.
wp ggds-switch scan # what is there, and what the switch proposes
wp ggds-switch show 42 # page 42 as the switch would clean it
wp ggds-switch run --dry-run # what would change; nothing is changed
wp ggds-switch run --short_name=NCA --official_host=nca.gov.gh --theme=nca
wp ggds-switch undo
wp ggds-switch tidy scan # placeholder content, and why each one was found
wp ggds-switch tidy apply --dry-run # what tidying would do; nothing is changed
wp ggds-switch tidy apply
wp ggds-switch tidy undo
wp ggds-switch tidy logThe same list of placeholder words is in @ggds/check, whose content.placeholder and content.wp-sample rules find them on any live website, WordPress or not.
The theme is a classic theme that outputs GGDS's own HTML, so its header, banner, footer and tab bar are the same as every other GGDS website's (a test compares them). Put your own CSS in a child theme's stylesheet: the theme removes the Customiser's "Additional CSS", which WordPress prints inline. The details are in the READMEs for the theme and GGDS Switch.
GGDS 0.5.0: ggds-wordpress-0.5.0.zip and ggds-switch-0.5.0.zip.
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.