I was going through a client’s 404 report and the top of the list was the same two paths I see on almost every busy WordPress site: /apple-touch-icon.png and /apple-touch-icon-precomposed.png. Hundreds a day. The devices asking for them never got an icon. They got WordPress’s full “page not found” page, rendered by PHP, for an image nobody would ever see.
The usual advice is to add a <link rel="apple-touch-icon"> tag. WordPress already outputs one when a Site Icon is set, and the devices ask anyway. They request the root path directly, whatever the page says. So I built a small plugin to answer the requests properly.
What it does
Easy Apple Icon answers requests for the Apple touch-icon paths with your Site Icon cropped square and converted to PNG at the right size. The first time each address is requested, it also saves the PNG into your site’s main directory. Subsequent requests are served by the web server directly as static files.
It only answers names it knows about: apple-touch-icon.png, apple-touch-icon-precomposed.png, and a list of sizes from 57 to 240 pixels. Anything else falls through to WordPress as normal. It only touches files it created. If you already have your own apple-touch-icon.png, it leaves that alone.
There’s no settings page. Set a Site Icon, and the plugin “just works”.
Installing it
The plugin is one file, easy-apple-icon.php. You can put it in one of three places.
As a must-use plugin. Upload the file to wp-content/mu-plugins/. You don’t need to activate it, and nobody can switch it off by accident. If the mu-plugins folder doesn’t exist, create it. This is the recommended method.
As a normal plugin. Create wp-content/plugins/easy-apple-icon/, upload the file into it, then activate it under Plugins.
In a child theme. Upload the file to your child theme’s folder, then add this line to the theme’s functions.php:
// Create/manage the Apple site icon. require_once __DIR__ . '/easy-apple-icon.php';
For hosting providers and agencies, you can use WP CLI to manage the Apple icons.
Checking it works
Visit https://your-site.example/apple-touch-icon.png. You should see your Site Icon. Then look in the folder that holds wp-config.php. There should be a file called apple-touch-icon.png. More appear over the following days, one for each size devices ask for.
What it doesn’t do
- It needs a Site Icon. Without one it answers with an empty “not found”, not the WordPress logo. That’s deliberate, because the logo looks wrong on a home screen.
- It needs a solid background. iPhones show transparent areas as black corners on the home screen.
- It doesn’t save files on multisite. Every site in a network shares one root directory, so one site’s icon would answer for all of them. Icons are still served.
- It does nothing when the home URL has a path, such as
example.com/blog/, because devices ask at the domain root. - It needs a writable root directory to save files. If WordPress can’t write there, icons are still served, but every request runs WordPress.
wp easy-apple-icon statustells you which case you’re in. - It doesn’t stop the requests. Devices still ask. The plugin answers them without rendering your theme’s 404 page.
Removing it
A normal plugin cleans up after itself when you deactivate it. A must-use plugin or a theme copy can’t, so it takes two steps. Remove the code first (for a theme copy, delete the require_once line before the file). Then delete the saved apple-touch-icon*.png files from the root directory. Hosts can run wp easy-apple-icon remove to do both the file clean-up and the state reset in one go.
If you skip the file clean-up, nothing breaks. The saved icons just stop updating when you change your Site Icon.
