{"id":22538250,"url":"https://github.com/cfpb/cfpb-wp-cli","last_synced_at":"2025-04-09T20:20:47.412Z","repository":{"id":17307449,"uuid":"20078049","full_name":"cfpb/cfpb-wp-cli","owner":"cfpb","description":"A collection wp-cli commands used at the CFPB.","archived":false,"fork":false,"pushed_at":"2015-03-23T13:59:43.000Z","size":255,"stargazers_count":5,"open_issues_count":1,"forks_count":24,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-23T22:12:26.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfpb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-22T21:46:02.000Z","updated_at":"2021-04-23T15:19:09.000Z","dependencies_parsed_at":"2022-09-14T22:55:03.977Z","dependency_job_id":null,"html_url":"https://github.com/cfpb/cfpb-wp-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fcfpb-wp-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fcfpb-wp-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fcfpb-wp-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Fcfpb-wp-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfpb","download_url":"https://codeload.github.com/cfpb/cfpb-wp-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104101,"owners_count":21048282,"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":[],"created_at":"2024-12-07T11:10:59.569Z","updated_at":"2025-04-09T20:20:47.387Z","avatar_url":"https://github.com/cfpb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CFPB WP CLI Commands\n\nCustom commands we use at CFPB to manage our site.\n\n## Installation\n\nInstall this as a plugin to your WordPress site. Then, if you have WP-CLI \ninstalled, you'll have access to the commands below.\n\n## Requirements\n\nWordPress 3.7 or higher running on PHP 5.3 or higher.\n\n## Commands\n\nJust two for now:\n\n- Migration\n    - [Taxonomy migration](#taxonomy-migration)\n    - [Author migration](#author-migration)\n- [Randomize taxonomy](#randomize)\n\n## Taxonomy Migration\n\nMigrate taxonomies like this:\n\n`wp migrate taxonomy \u003cfrom\u003e \u003cto\u003e`\n\nIt takes the following optional argument:\n- `--post_type` a comma separated list of all post types to migrate\n- `--exclude` a comma separated list of any post id to exclude\n- `--after` a date string formatted like 2013-01-31 will only run the\n    command on posts newer than January 31, 2013\n- `--before` opposite of after\n- `--term` a comma separated list of specific terms to migrate (currently unimplemented)\n\nThe command will loop through each post and create new taxonomy-term\nrelationships for each on the target taxonomy. If post 'foo' had tags 'bar' and\n'baz' it will now have groups 'bar' and 'baz' as well\n\n### Examples\n`wp migrate taxonomy tag group` will migrate taxonomy-term relationships for\ntags on all posts in the WordPress database to a taxonomy called group\n`wp migrate taxonomy tag group --post_type=post` will migrate the tags on only\nposts and exclude all other taxonomies with tags\n`wp migrate taxonomy tag group --exclude=1,2,3,5,8` will exclude posts 1, 2, 3,\n5, and 8 from the migration.\n\n## Author Migration\n\nMigrate authors like this:\n\n`wp migrate author`\n\nBy default it will attempt to migrate all native authors to a taxonomy called \n\"author\" failing that it will save the author in custom fields. Pass the type\nargument to specify a different taxonomy in which to save authors.\n\nIt takes the following optional arguments:\n- `type` the name of a custom taxonomy to migrate authors to (default: author)\n- `--include` a comma separated list of any post id to include (will exclude all\n  others, default: all)\n- `--exclude` a comma separated list of any post id to exclude (default: none)\n- `--post_type` the name of the post type to target (default: post)\n- `--authors` a comma separated list of authors to migrate, will exclude all others\n- `--before` a date string formatted like 2013-01-31 will only run the command on\n  posts older than January 31, 2013\n- `--after` opposite of before\n- `--ignore_term` a list of taxonomy terms to ignore. The first item in this comma\n  separated list should be the taxonomy and all following should be the terms\n\n### Examples\n\n`wp migrate author` will migrate all native authors (read: users) on posts to a\ntaxonomy called \"author\" or a custom field if that taxonomy does not exist\n`wp migrate author post_tag` will migrate all authors on posts to tags\n`wp migrate author --post_type=custom` will migrate all authors on post objects of\nthe post type `custom`\n`wp migrate author --post_type=custom --ignore_term=category,featured,sticky` will\nmigrate authors on all posts in the \"custom\" post type that do not have categories\nfeatured or sticky\n\n\n## Randomize\n\nAllows you to assign random taxonomy terms to a post or set of posts. \n\nUsage: `wp randomize taxonomy category`\n\nBy default all objects of the 'post' post type will be randomized, use the\n`--post_type` flag to target pages or a custom post type. Use the `--include` \nand `--exclude` flags to filter or ignore specific object IDs and the `--before`\nand `--after` flags to specify a date range. Also, optionally pass `--terms` as\na list of terms you want to use for the randomization. Failing that, if terms exist \nin the target taxonomy, those terms will be used. If not, a string of 6 words \ngenerated randomly will be used for the randomization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Fcfpb-wp-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfpb%2Fcfpb-wp-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Fcfpb-wp-cli/lists"}