{"id":19055410,"url":"https://github.com/evotecit/pswordpress","last_synced_at":"2025-08-24T00:16:21.971Z","repository":{"id":95331774,"uuid":"357127438","full_name":"EvotecIT/PSWordPress","owner":"EvotecIT","description":"PSWordPress is PowerShell Module that allows interacting with WordPress using PowerShell via Rest API. It allows to list, create, edit or remove posts, pages, etc.","archived":false,"fork":false,"pushed_at":"2024-12-17T11:21:10.000Z","size":81,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T12:18:44.254Z","etag":null,"topics":["api","powershell","restapi","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvotecIT.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"PrzemyslawKlys","custom":["https://paypal.me/PrzemyslawKlys"]}},"created_at":"2021-04-12T09:07:39.000Z","updated_at":"2024-12-17T11:21:15.000Z","dependencies_parsed_at":"2025-04-17T23:50:11.255Z","dependency_job_id":null,"html_url":"https://github.com/EvotecIT/PSWordPress","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"e4f556b9b7ac134bf22f744e0877694e91970637"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvotecIT%2FPSWordPress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvotecIT%2FPSWordPress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvotecIT%2FPSWordPress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvotecIT%2FPSWordPress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvotecIT","download_url":"https://codeload.github.com/EvotecIT/PSWordPress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250561347,"owners_count":21450406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","powershell","restapi","wordpress"],"created_at":"2024-11-08T23:44:48.209Z","updated_at":"2025-04-24T04:21:24.767Z","avatar_url":"https://github.com/EvotecIT.png","language":"PowerShell","funding_links":["https://github.com/sponsors/PrzemyslawKlys","https://paypal.me/PrzemyslawKlys"],"categories":[],"sub_categories":[],"readme":"﻿\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.powershellgallery.com/packages/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/powershellgallery/v/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.powershellgallery.com/packages/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/powershellgallery/vpre/PSWordPress.svg?label=powershell%20gallery%20preview\u0026colorB=yellow\u0026style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/EvotecIT/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/github/license/EvotecIT/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.powershellgallery.com/packages/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/powershellgallery/p/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/EvotecIT/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/top/evotecit/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/EvotecIT/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/code-size/evotecit/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.powershellgallery.com/packages/PSWordPress\"\u003e\u003cimg src=\"https://img.shields.io/powershellgallery/dt/PSWordPress.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://twitter.com/PrzemyslawKlys\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/PrzemyslawKlys.svg?label=Twitter%20%40PrzemyslawKlys\u0026style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://evotec.xyz/hub\"\u003e\u003cimg src=\"https://img.shields.io/badge/Blog-evotec.xyz-2A6496.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.linkedin.com/in/pklys\"\u003e\u003cimg src=\"https://img.shields.io/badge/LinkedIn-pklys-0077B5.svg?logo=LinkedIn\u0026style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# PSWordPress - PowerShell Module\n\n**PSWordPress** is PowerShell Module that allows interacting with WordPress using PowerShell via Rest API. It allows to **list**, **create**, **edit** or **remove** posts, pages, etc.\n\n## Documentation - Development\n\nPSWordPress uses Wordpress API. I've added minimal amount of cmdlets that I need for myself. Feel free to create issues or PRs when needing something more.\n\n- [x] [Wordpress Rest API](https://developer.wordpress.org/rest-api/)\n- [X] [Wordpress API](https://developer.wordpress.com/docs/api/)\n\n## Installation\n\n### Option 1\n\nBy default WordPress since version 5.6 allows application passwords to be used to for accounts (make sure to have it enabled in Wordfence, as it blocks it by default).\n\n- Generate Application Password\n    - Go the **User Profile** page of the user that you want to **generate a new application password** for.\n    - To do so, **click Users** on the left side of the **WordPress admin**, then click on the user that you want to manage.\n    - Scroll down until you see the **Application Passwords** section. This is typically at the bottom of the page.\n    - Within the input field, type in a name for your **new application password**, then click Add New.\n    - Note: The application password name is only used to describe your password for easy management later. It will not affect your password    in any way. Be descriptive, as it will lead to easier management if you ever need to change it later.\n    - Once the Add New button is clicked, your **new application password** will appear. Be sure to keep this somewhere safe, as it will not    be displayed to you again. If you lose this password, it cannot be obtained again.\n- Install this PowerShell module\n\n```powershell\nInstall-Module PSWordPress -Force\n```\n\n### Option 2\n\nIf you have older version of WordPress or preffer using Basic Authentication method it can be used using following plugin\n\n- Install [WP API SwaggerUI Wordpress Plugin](https://wordpress.org/plugins/wp-api-swaggerui/) to allow WordPress API via Basic Authentication\n    - Your login and password are the same as any user you create in WordPress\n    - Feel free to create new user with proper role rights that works with RestAPI\n- Install this PowerShell module\n\n```powershell\nInstall-Module PSWordPress -Force\n```\n\n### Option 3\n\nAlternatively if you have older version of WordPress, you can use application passwords plugin. Keep in mind this method works as the one from option 1, just thru plugin.\n\n- Install [Application Passwords Wordpress Plugin](https://wordpress.org/plugins/application-passwords/)\n    - Go the **User Profile** page of the user that you want to **generate a new application password** for.\n    - To do so, **click Users** on the left side of the **WordPress admin**, then click on the user that you want to manage.\n    - Scroll down until you see the **Application Passwords** section. This is typically at the bottom of the page.\n    - Within the input field, type in a name for your **new application password**, then click Add New.\n    - Note: The application password name is only used to describe your password for easy management later. It will not affect your password    in any way. Be descriptive, as it will lead to easier management if you ever need to change it later.\n    - Once the Add New button is clicked, your **new application password** will appear. Be sure to keep this somewhere safe, as it will not    be displayed to you again. If you lose this password, it cannot be obtained again.\n- Install this PowerShell module\n\n```powershell\nInstall-Module PSWordPress -Force\n```\n\n## Usage\n\nUsing this PowerShell module requires having UserName and Password. You can provide UserName and Password directly to `Connect-WordPress` using proper properties or you can convert them to e\n\n### Preparing credentials\n\n```powershell\n\n# Prepare secure string\n$password = ConvertTo-SecureString -String \"PasswordFromWordpressUser or Application Password depending on which plugin is in use\" -AsPlainText -Force\n$password | ConvertFrom-SecureString | Set-Clipboard\n\n# Build credentials object for automation or simply do Get-Credential\n# take the string from above (should be in clipboard) and insert it into next lines\n$SecurePassword = ConvertTo-SecureString -String '01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b097b77a31ba66459ff93f9d4c6ff7230000000002000000000003660000c000000010000000a73395656a769b97f78cb9325ea6b84b0000000004800000a000000010000000b454d82939445c8382d57c049daf6c0e380000000a54f7fe5c0698eb4c2e24eca177803e0ef55a4f7da08d8049a5c0833a5751466a341a5312ec69e48d4bc072f97e5bade35d8d974bfe605f140000004c8d273e496d4ef468a3d6d8dff51cd5971b2dd0'\n$Credentials = [System.Management.Automation.PSCredential]::new('PowerShell', $SecurePassword)\n\n# Alternatively\n$Credentials = Get-Credential -UserName 'PowerShell'\n```\n\n### Get WordPress posts\n\n```powershell\n# Build credentials object for automation or simply do Get-Credential\n$SecurePassword = ConvertTo-SecureString -String '01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b097b77a31ba66459ff93f9d4c6ff7230000000002000000000003660000c000000010000000a538851b69af1543cfcf67bb78e4ed990000000004800000a000000010000000e8b1946cd7316a6668efc759385d03a7400000005b730cc9cbb1ab2c1fda426e71b2cfd68c6b66ec0f1fb895f0af132df3feddd6494237064bc7469d0ccc34655c579585c88f376c702ffbfeba0eea53d7bfa36c14000000f20d8b0686321544ff2ca62f21fc8c28fa86c672'\n$Credentials = [System.Management.Automation.PSCredential]::new('PowerShell', $SecurePassword)\n\n# Authorize to Wordpress\n$Authorization = Connect-Wordpress -Credential $Credentials -Url 'https://evotec.xyz/'\n\n# List posts (default 10) with specifc tags\n$List = Get-WordPressPost -Authorization $Authorization -Verbose\n$List | Format-Table\n```\n\nMore how-to shown in [Examples](https://github.com/EvotecIT/PSWordPress/tree/master/Examples) folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevotecit%2Fpswordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevotecit%2Fpswordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevotecit%2Fpswordpress/lists"}