# Apple Shortcut to upload photos to WordPress Media Library

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/
- Published: 2023-02-05T22:22:31-05:00
- Author: Chuck Grimmett

UPDATE 11 Feb 2023:

Good news! I refactored this to work with the Share Sheet and to prompt you for 
credentials and a media endpoint on the initial setup.

Here is the new link: [https://www.icloud.com/shortcuts/cf31d94107e24e5e947a801fb9d8132c](https://www.icloud.com/shortcuts/cf31d94107e24e5e947a801fb9d8132c)

Here is how easy it is to use on macOS.

![](https://i0.wp.com/cagrimmett.com/wp-content/uploads/2023/02/CleanShot-2023-02-
11-at-13.25.05.gif?resize=800%2C488&ssl=1)

And here is how easy it is to use on iOS:

---

Tonight I sat down and figured out something that has been in my head for months:
Uploading photos to my WordPress Media Library with an Apple Shortcut. It works 
on both macOS and iOS.

I use the [REST API](https://developer.wordpress.org/rest-api/reference/media/#create-a-media-item)
to upload them to the /wp/v2/media endpoint via a POST request. For authentication
I use a username and Application Password that I base64 encode.

Here is the basic workflow:

 * Select the photos
 * Loop through them and convert them to JPEGs. This is necessary because WordPress
   does not currently handle HEIC images, the default iOS image format.
 * Use a POST request to upload the converted JPEGs to the /wp/v2/media endpoint.

![](https://i0.wp.com/cagrimmett.com/wp-content/uploads/2023/02/CleanShot-2023-02-
05-at-22.21.58%402x.png?resize=1264%2C1538&ssl=1)

You currently have to run this from Shortcuts.app. Share sheet support does not 
work on macOS Monterey, so I still have the step in there to pick images from Photos.
app. I know they added this in Ventura, but I haven’t upgraded yet. Once I do, I’ll
change this to only take images from the Share sheet so you can start in Photos.
app rather than Shortcuts. I know share sheet support works on iOS, but since I 
blog most on my Mac, I wanted to make a shortcut that works in both places.

If you’d like to use this Shortcut, you can get it here: [https://www.icloud.com/shortcuts/e473f76d1692444896077ebcdbc4c893](https://www.icloud.com/shortcuts/e473f76d1692444896077ebcdbc4c893)

If you use it, you’ll need to make two changes:

 1. In the Text area at the top, put your WordPress Username and [Application Password](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/)
    in this format: `username:password`
 2.  * Application passwords are found under wp-admin -> Users -> your user profile-
       > Application passwords
 3. Change the domain from example.com to your website’s domain.

## Comments

### By: Chris Hardie

- Link: https://mastodon.social/@ChrisHardie/109817948923422055
- Published: 2023-02-06T08:08:37-05:00

[@cagrimmett](https://toot.cafe/@cagrimmett) the sluggishness and number of steps
getting photos from my mobile device to my WP media library has really been a deterrent
to photo blogging for me. I’d tinkered with trying to make the mobile app do it 
better but never got very far. This looks like the missing piece! Thank you.

Loading...

### By: Chuck Grimmett

- Link: https://toot.cafe/@cagrimmett/109847596569478487
- Published: 2023-02-11T13:48:25-05:00

Good news! I refactored this to work with the Share Sheet. Here is how easy it is
to use on macOS.

Loading...

### By: Chuck Grimmett

- Link: https://toot.cafe/@cagrimmett/109847603212831180
- Published: 2023-02-11T13:50:06-05:00

And here is how easy it is to use on iOS:

Loading...

### By: Chuck Grimmett

- Link: https://toot.cafe/@cagrimmett/109847604619996933
- Published: 2023-02-11T13:50:27-05:00

New iCloud link to download the shortcut: [https://www.icloud.com/shortcuts/cf31d94107e24e5e947a801fb9d8132c](https://www.icloud.com/shortcuts/cf31d94107e24e5e947a801fb9d8132c)

[Shortcuts](https://www.icloud.com/shortcuts/cf31d94107e24e5e947a801fb9d8132c)

Loading...

### By: Chuck Grimmett

- Link: https://toot.cafe/@cagrimmett/109847606188108421
- Published: 2023-02-11T13:50:51-05:00

[@ChrisHardie](https://mastodon.social/@ChrisHardie) Check the original post – I
refactored it to make it easier to use!

Loading...

### By: Jackson Whelan

- Link: https://twitter.com/jaxonwheelin/status/1624496467011600384
- Published: 2023-02-11T14:51:54-05:00

Love this!
 [](https://cagrimmett.com/) [](https://twitter.com/cagrimmett)

Loading...

### By: Week of February 6, 2023

- Link: https://cagrimmett.com/week-of/2023/02/11/week-of-february-6-2023/
- Published: 2023-02-25T21:35:28-05:00

This Article was mentioned on [cagrimmett.com](https://cagrimmett.com/week-of/2023/02/11/week-of-february-6-2023/)

Loading...

### By: derHeiko

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-30776
- Published: 2023-08-14T13:41:39-04:00

Thank you very much . Greetings from Germany.

Loading...

### By: Dave's linkblog

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-32570
- Published: 2023-10-17T16:55:54-04:00

\[…\] Apple Shortcut to upload photos to WordPress Media Library \[…\]

Loading...

### By: Velanche

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-42341
- Published: 2025-03-17T22:47:20-04:00

Greets! This looks promising. I tried running the shortcut (the latest version) 
and did not get any errors as far as I know, but I do not see the test images I 
uploaded in the media library of my hosted WP account. I typed in the default path
you’ve suggested, so not sure where things might have gone wrong. Suggestions?

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-43567
- Published: 2026-02-12T23:11:18-05:00

Hi! Is this on macOS or iOS? I’ve noticed this problem on macOS, and I think the
root of the problem is how macOS handles image data when passing it to the Get Contents
of URL step. I’ll try some time to debug it. In the meantime, iOS should work just
fine.

Loading...

### By: M27

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-43563
- Published: 2026-02-12T14:51:11-05:00

Hi there ! I‘ve got the same problem, the shortcut seems to upload, but it does 
not appear in the media library.

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-43566
- Published: 2026-02-12T23:10:46-05:00

Hi! Is this on macOS or iOS? I’ve noticed this problem on macOS, and I think the
root of the problem is how macOS handles image data when passing it to the Get Contents
of URL step. I’ll try some time to debug it. In the meantime, iOS should work just
fine.

Loading...

### By: M27

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-43569
- Published: 2026-02-13T02:19:48-05:00

Its on the latest iPad IOS, my mac os is outdated for this 😉
 Actually I was looking
for a feature to post the image from my iPhone directly, without converting and 
then manually posting. If that would be possible, I think it would be a very interesting
app. Pls. contact me if you see a possibility.

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-43571
- Published: 2026-02-13T11:25:00-05:00

Okay! I’m sorry, I don’t know what the root of the problem is.

Have you tried using the Jetpack App for posting images directly from your phone?
Alternatively, if you want to use a Shortcut action, you can either use Micropub(
see [https://cagrimmett.com/development/2023/02/12/ios-shortcut-actions-for-micropub-posting/](https://cagrimmett.com/development/2023/02/12/ios-shortcut-actions-for-micropub-posting/))
or the regular WordPress REST API ([https://cagrimmett.com/2023/11/09/apple-shortcuts-for-posting-to-wordpress-via-the-rest-api-and-xml-rpc-metaweblog-api/](https://cagrimmett.com/2023/11/09/apple-shortcuts-for-posting-to-wordpress-via-the-rest-api-and-xml-rpc-metaweblog-api/))

Loading...

### By: Heic to PNG

- Link: https://cagrimmett.com/2023/02/05/apple-shortcut-to-upload-photos-to-wordpress-media-library/#comment-44419
- Published: 2026-11-05T20:59:25-05:00

The Share Sheet update makes this much more convenient for photo blogging. Given
the upload issues mentioned in the comments, showing a confirmation with the uploaded
image’s URL would be a useful addition. It would help distinguish a completed upload
from a shortcut that simply finished running.

Loading...
