Title: WP CLI generate missing nextgen not working
Last modified: May 23, 2024

---

# WP CLI generate missing nextgen not working

 *  Resolved [gregnsn](https://wordpress.org/support/users/gregnsn/)
 * (@gregnsn)
 * [2 years ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/)
 * I have a problem when I execute the WP CLI command: wp imagify generate-missing-
   nextgen wp
   The command returns a Fatal error and asks me for a supplementary 
   argument that seems to be the “Format”.
 * Fatal error: Uncaught ArgumentCountError: Too few arguments to function Imagify\
   Bulk\Bulk::run_generate_nextgen(), 1 passed in /htdocs/wp-content/plugins/imagify/
   classes/CLI/GenerateMissingNextgenCommand.php on line 19 and exactly 2 expected
   in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php:223
   Stack trace: 
   0 /htdocs/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.
   php(19): Imagify\Bulk\Bulk->run_generate_nextgen() 1 [internal function]: Imagify\
   CLI\GenerateMissingNextgenCommand->__invoke() 2 phar:///usr/local/bin/wp/vendor/
   wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
   3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
   4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.
   php(488): call_user_func() 5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/
   WP_CLI/Runner.php in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php
   on line 223

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [2 years ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17776189)
 * Hello,
 * I understand you’re encountering an error when trying to generate missing next-
   gen images with the `wp imagify generate-missing-nextgen` command.
 * The issue is that the command requires an additional argument specifying the 
   format you want to generate (WebP or AVIF).
 * Here’s the corrected command format:
 * `wp imagify generate-missing-nextgen <format>
   Replace <format> with either webp
   or avif depending on your preference.
 * For example, to generate WebP versions:
 * `wp imagify generate-missing-nextgen webp
   Remember to enable WebP or AVIF generation
   in your Imagify settings before running the command.
 * I hope this helps! Let me know if you have any other questions.
   Best Regards,
   Saransh.
 *  Thread Starter [gregnsn](https://wordpress.org/support/users/gregnsn/)
 * (@gregnsn)
 * [2 years ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17776415)
 * Hello,
   Thank you for your answer.But I have the same error when I use: `wp imagify
   generate-missing-nextgen webp`Webp format is enabled in settings
 * ![](https://wordpress.org/ed82fb97-edcf-4989-b294-c88d05f576de)
 *     ```wp-block-code
       wp imagify generate-missing-nextgen webp
       Fatal error: Uncaught ArgumentCountError: Too few arguments to function Imagify\Bulk\Bulk::run_generate_nextgen(), 1 passed in /app/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php on line 19 and exactly 2 expected in /app/wp-content/plugins/imagify/classes/Bulk/Bulk.php:223
       Stack trace:
       #0 /app/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php(19): Imagify\Bulk\Bulk->run_generate_nextgen()
       #1 [internal function]: Imagify\CLI\GenerateMissingNextgenCommand->__invoke()
       #2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
       #3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
       #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
       #5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
       #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner-> in /app/wp-content/plugins/imagify/classes/Bulk/Bulk.php on line 223
       ```
   
 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [2 years ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17787993)
 * Hello,
   I’m sorry about that.Can you please try below and see if it helps?
 *     ```wp-block-code
       wp imagify generate-missing-nextgen wp webp
       ```
   
 * Best Regards,
 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17798724)
 * Hi,
 * I’m following up to see if I left any of your questions about Imagify unanswered?
   
   If all is well, there’s no need to reply, and I will just close our conversation.
 * However, if you have any further questions about Imagify, feel free to let me
   know, I’ll gladly continue to assist you.
 * Thanks!
   Marko
 *  [kipzes](https://wordpress.org/support/users/kipzes/)
 * (@kipzes)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17949141)
 * I’ve tried several commands but I’m still getting the Too few arguments to function
   error. The version I’ve installed is 2.2.2
 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17953365)
 * Hey [@kipzes](https://wordpress.org/support/users/kipzes/),
 * Our developers have confirmed that this is a bug, and it has been added to their
   list of issues to address. Unfortunately, I don’t have an ETA for when this will
   be resolved at the moment but you can track it here: [https://github.com/wp-media/imagify-plugin/issues/885](https://github.com/wp-media/imagify-plugin/issues/885)
 * Thank you for your understanding.
   Best Regards,Saransh.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘WP CLI generate missing nextgen not working’ is closed to new replies.

 * ![](https://ps.w.org/imagify/assets/icon-256x256.gif?rev=3452959)
 * [Imagify: Optimize Images for Top Speed (Compress & Convert to WebP/AVIF)](https://wordpress.org/plugins/imagify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/imagify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/imagify/)
 * [Active Topics](https://wordpress.org/support/plugin/imagify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/imagify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/imagify/reviews/)

## Tags

 * [wpcli](https://wordpress.org/support/topic-tag/wpcli/)

 * 6 replies
 * 3 participants
 * Last reply from: [WP Media](https://wordpress.org/support/users/wp_media/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/wp-cli-generate-missing-nextgen-not-working/#post-17953365)
 * Status: resolved