Website hygiene with WordPress

Published: 26 July, 2022 | Category: WordPress Help

This article is aimed at experienced users of WordPress. It will also help people who have taken over a website that was previously managed by someone else.

What is website hygiene?

It is the name I give to the practice of removing material your site is not using. You’ll be amazed how many images, pages and posts hang around long after they have outlived their usefulness!

Although hygiene is not essential to keep the site functioning, there are two good reasons for practising it:

  • It lightens your website’s digital footprint. Websites occupy space in the digital world and many hosts offer cheaper packages for smaller, leaner sites.
  • It makes the admin end easier to navigate. Lots of unused images or draft pages can cause confusion for you and others working on the site.

Website hygiene is especially relevant to complex websites with more than one amin. Ideally, an organisation should identify one person whose job is to go through material and make sure all of it is still relevant.

Remove unused or duplicate Images

If you delete a post or page from the website, its associated images remain in the Media Library. Removing them is a separate step. Be careful that the same images are not in use elswhere. Likewise, remove duplicates if they you uploaded them by mistake.

Duplicates are the result of the same image being loaded twice, either because the person who needs an uploaded image can’t find it, or because they think the first upload didn’t work. Sometimes you have to refresh the dashboard page for an image to appear in the library.

WordPress distinguishes duplicates from the originals by adding extra numbers to the filename. So if the original is my-image.jpg, the system will rename the duplicate my-image-1.jpg. You can check this by clicking on the image to reveal its attachment details and looking in the box labelled File URL (scroll to the right inside the box). Use either one on the website and remove the other.

Image attachment details

There are ways of finding out whether an image is in use on the website. Obviously, you should have a good look at the front end and see if you can find it. If not, go to the Media Library, click in the options box that says All Media Items and choose Unattached. This is a crude technique that will correctly identify unattached images but it will also list some that are in use. Some may be featured images. Others be hard-coded by your theme designer as logos or other essential graphics. So be careful what you delete.

As a rule of thumb, if you are about to delete a post or page, make a mental note of the associated images and search visually for them in the Unattached list.

Unattached images in media library

There are plugins that refine the process of listing unattached images but still, use them with caution.

Delete dead-end pages

The rule here is to remove all pages that are not linked to from anywhere on the site. Checking this is easier said than done because not all pages have a link from the main navigation. There may be a top-level page where with links to several sub-pages that break up complex information.

In the Pages list on the Dashboard, go through each page and make sure you can identify where it fits in with the the scheme of the site. If you can’t, does it look as relevant? Who wrote it, and how long ago? Is that person still with the organisation?

Don’t keep draft pages any longer than needed: either delete or, if they are ready, publish.

Website hygiene: remove or publish draft pages

The Author column shows who wrote the page.

To delete a page from the list of Pages, hover over its title and click “Bin” or “Trash” (depending on UK or US English). This will move it to the Bin. You can remove it permanently from the Bin once you are certain you don’t want it. If you do feel you still need that page, click “restore”. Check what images appear on that page and delete them if you don’t see them elsewhere on the website.

Old blog posts

Old events that are not longer relevant can linger in the list of blog posts, alongside out-of-date instructions for technologies that have moved on. Too many writers don’t remove items that are 10 or 15 years out of date: don’t become one of those! If you have personal reasons for wishing to keep old material, find ways of archiving it without leaving it on the open internet.

With draft posts, same rule as for pages: remove or publish as appropriate. Delete in the same way as pages, checking the images first, and remove permanently from the Bin or Trash.

Former users and login holders

Website hygiene also applies to the management of users. If your site has many users, check that they still have a right to logins. Have they left the organisation, or changed role? Do they still contribute to the website? Each user represents a security risk, so remove any you don’t recognise. If they are legimate they will soon let you know! You can reinstate them by creating new logins for them.

Users section in WordPress

To remove a user, click on the list of users, hover over the one earmarked for removal, and click Delete. The system will then ask you what to do with the material they created: delete it or attribute to yourself or another user. What you do here obviouly depends on what the material is. To see what a user has contributed, go to the lists of Posts and Pages and filter by author.


Hygiene is part of good website management. We recommend that you allocated it a regular diaried slot in your schedule. It also provides an opportunity to check everything is up to date: have any contact details changed? Are events still as advertised?

It is also another way of telling the search engines that your website is being cared for, and therefore still relevant to its niche.


Category: WordPress Help

← Previous post: WordPress Image Galleries

→ Next post: Your WordPress website's security