Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. Running WP CLI in bulk across WP apps, or running them remotely?

Running WP CLI in bulk across WP apps, or running them remotely?

Scheduled Pinned Locked Moved WordPress (Developer)
3 Posts 2 Posters 584 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d19dotcaD Offline
      d19dotcaD Offline
      d19dotca
      wrote on last edited by
      #1

      Hello,

      I'm using MainWP for managing my sites remotely and it works well in most cases, however there's been the odd time where for various reasons I had wanted to run some WP CLI commands either in bulk or at least remotely... was just curious if anyone has accomplished something like that before. Currently MainWP doesn't allow for remotely executing WP CLI commands (though I filed a feature request for them so maybe that'll be added in the distant future).

      Example: I want to run wp media regenerate --yes (https://developer.wordpress.org/cli/commands/media/regenerate/) across all my websites using WP CLI to regenerate all thumbnails and their sizes.

      --
      Dustin Dauncey
      www.d19.ca

      martinkbsM 1 Reply Last reply
      1
      • d19dotcaD d19dotca

        Hello,

        I'm using MainWP for managing my sites remotely and it works well in most cases, however there's been the odd time where for various reasons I had wanted to run some WP CLI commands either in bulk or at least remotely... was just curious if anyone has accomplished something like that before. Currently MainWP doesn't allow for remotely executing WP CLI commands (though I filed a feature request for them so maybe that'll be added in the distant future).

        Example: I want to run wp media regenerate --yes (https://developer.wordpress.org/cli/commands/media/regenerate/) across all my websites using WP CLI to regenerate all thumbnails and their sizes.

        martinkbsM Offline
        martinkbsM Offline
        martinkbs
        wrote on last edited by
        #2

        Hi @d19dotca,

        Yes, it is possible, and with n8n it is easy.

        You just need to have SSH access to each website you want to manage to run the WP-CLI command you want. In Cloudron, since there is no external SSH access to the application, you have to identify the container ID that corresponds to the website, in order to run a docker exec.

        docker exec CONTAINERID wp media regenerate --yes
        

        In this example workflow from n8n you can see how you can do all the actions you want, executing them manually, through a cron or with the trigger you want.

        e1f09c71-0b3b-4a4d-8e4d-2e6111bff774-image.png

        1940f91c-f5a2-49be-b64b-f4464a50c002-image.png

        d19dotcaD 1 Reply Last reply
        5
        • martinkbsM martinkbs

          Hi @d19dotca,

          Yes, it is possible, and with n8n it is easy.

          You just need to have SSH access to each website you want to manage to run the WP-CLI command you want. In Cloudron, since there is no external SSH access to the application, you have to identify the container ID that corresponds to the website, in order to run a docker exec.

          docker exec CONTAINERID wp media regenerate --yes
          

          In this example workflow from n8n you can see how you can do all the actions you want, executing them manually, through a cron or with the trigger you want.

          e1f09c71-0b3b-4a4d-8e4d-2e6111bff774-image.png

          1940f91c-f5a2-49be-b64b-f4464a50c002-image.png

          d19dotcaD Offline
          d19dotcaD Offline
          d19dotca
          wrote on last edited by
          #3

          @martinkbs Ah very interesting! I'll have to look deeper into that option. Pretty cool looking. Thanks for the idea. 🙂

          --
          Dustin Dauncey
          www.d19.ca

          1 Reply Last reply
          3
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search