CLI create post with custom rank math settings
-
Hello ?? ,
I need to automate creating some posts. They all need to have the same seo settings. Until now I just set the default rank math settings to whatever I needed and created them all automated using the cli.
In Production Phase I must not change the default Rank Math settings before creating these posts.
Is there any way to create posts via a php script or cli (php prefered) and define the seo settings for this post?
Until now I did it like this:
// First of all change Rank Math SEO Settings // define command §TLD is a replacer $_command = "wp post create content.txt --post_title=\".§TLD Domain\" --post_name=§TLD-domain --post_category=domains --post_status=publish"; // define array that replaces §TLD $tlds = array("be", "best"); // Loop through array foreach ( $tlds as $tld ) { // Replace Replacer and execute command $command = str_replace("§TLD", $tld, $_command); exec($command, $output); echo "\n---\n"; var_dump($output); echo "\n---\n"; unset($output); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘CLI create post with custom rank math settings’ is closed to new replies.