• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Get WP get_home_path() via CLI

gbotica

Regular Pleskian
Hi,

In Plesk 12.5, I could use:

Code:
plesk bin wp_instance --get-list

to get a list of all the "attached" WordPress sites in Plesk. However, the only useful thing returns in the Installation URL.

I thought I read that this was later enhanced to return the webroot of each WP instance as well. But now wp_instance appears to be gone in Onyx?

So, I ended up using:

Code:
SELECT dom.id, dom.name, h.www_root FROM domains dom LEFT JOIN DomainServices d ON (dom.id = d.dom_id AND d.type = 'web') LEFT JOIN hosting h ON h.dom_id = dom.id

To get a list of: site.domain | webroot path

However, it would be great to be able to get: site.domain | get_home_path() using the WP CLI?

Is there a way to do this with Plesk Onyx?

Thanks for your time.
 
Hello,

In Plesk Onyx you have an ability to retrieve short or full information about WordPress instances using --list or --info CLI commands correspondingly. For example:

plesk ext wp-toolkit --list
plesk ext wp-toolkit --info -instance-id 123
plesk ext wp-toolkit --info -domain-id 12 -path /httpdocs

Output of --list command conatins following data:
  • WordPress instance identity
  • Main domain (subscription) identity
  • Path to WordPress files, related to main domain root directory
  • Instance owner identity
  • Flag, is instance works properly (is alive)
  • WordPress site URL
  • Name of WordPress instance
  • Version of WordPress
  • Count of installed plug-ins (optional)
  • Count of installed themes (optional)
Output of --info command contains all available WordPress instance data, including configuration paramentes, plug-ins and themes details, etc.

Also, you can retrive data in JSON by using key '-format json'. See 'plesk ext wp-toolkit --help' for details.

This feature available since vesion 2.0.4 of WordPress Toolkit Plesk extension.
 
Thank you so much! I was not aware of how to access the WP Toolkit's CLI.

I have now found this documentation: WordPress Toolkit in Plesk

This is what i used to get all WP Toolkit instances site name and path:

Code:
plesk ext wp-toolkit --info -instance-id 1 -format json | jq --raw-output '.name, .full_path'

This will be useful when scripting, I can use:

Code:
plesk ext wp-toolkit --list -format json | jq '.[] .id'

To get a list of all Wp Toolkit instance iDs, then loop through the IDs, doing WP-CLI stuff, like this:

Code:
plesk ext wp-toolkit --wp-cli -instance-id 1 -- core verify-checksums
 
Back
Top