You may have noticed I’m posting a lot more lately. It’s partly because I’m not working, plus a bit of conscious effort… plus a couple effort-saving shortcuts I’ve set up.
In the past, I used to share images to Instagram and then had an IFTTT applet run to post those images to WordPress as blog posts. I wanted to flip that model and instead first post to my own site, and THEN have the option of sharing to Instagram or other social networks. The solution I’ve landed on is to use an iOS Shortcut as a Share Sheet action. That means I take a photo, click the Share button, and then click the Post with Pic shortcut.
The Shortcut first prompts me for a Post Title, Post Content, and Image Alt Text. It then converts the image to a JPG and uploads it to the WordPress Media API along with the title and alt text. Next, it creates a new post with the title and content, and sets the newly uploaded image as the Featured Image for the post. It also copies the Post Content to the clipboard and reopens the Share Sheet in case I want to then post the image to Instagram or any other social networks. Lastly, it opens my site so I can see the new post.
As you can see, it’s a pretty lengthy Shortcut. You can download a blank version for yourself from here. There are a few places you’ll need to tweak and customise for your own setup. (I recommend doing that on your laptop rather than trying to do it on the phone directly.) You’ll first need to set up an Application-Specific Password for your WordPress User. There’s a Text action where you’ll need to put in your WordPress username and that application-specific password for authentication. There are also three places where you need to replace [yourdomain] with the URL to your own site. Once you’ve got it updated, click the Info icon and make sure you’ve checked “Show in Share Sheet.” Then you should be good to go! (I built this based on Chuck Grimmett’s Shortcut and helpful blog post.)
And yes, I know that Shortcuts has a “Post to WordPress” action built in. However, I could not get the damn thing to work! I suspect it’s because it uses XML-RPC, and I have that locked down for security. This version with the Rest API works just fine.
There’s a second Shortcut in the Share Sheet above: Upload Images to WordPress. This is for when I have a number of images I want to use in a post. You can upload through the WordPress iOS app, but I’ve found it clunky and slow. It also defaults to uploading at full resolution too. This shortcut works a lot better. I simply select several images in the Photos app, hit Share, and then the relevant Shortcut. It converts each one to JPG and resizes to 1000px wide before uploading. You can grab it here. Again, you’ll need to put in your username and application password. You’ll also need to put your domain name in for the API URL. You may also need to give it some permissions the first time you run it. Depending on how powerful your server is, you may need to limit how many photos you try to upload at once. Note: this one doesn’t do any titles or alt text. But this is for bulk uploading, and I then add in the metadata when I’m composing the post itself.
I hope you find these useful!