I've recently started using wp-cli to work on WordPress and starting to love it.

However, I'm curious about creating page templates using wp-cli. I haven't been able to find anything on it, does anyone if I can create a page template using wp-cli.

I found the scaffold command but that also doesn't have the option to create it.

Wouldn't it be nice, if wp-cli has that option too?

If it already does, then do please enlighten me.

2 Answers 2


wp-cli is not a development tool, it is a server admin tool, as such all the scaffold stuff there is.... for lack of better word, unneeded bloat. It is unlikely to reflect best practice, especially if your copy is old.

In the specific case of page templates, there is really nothing worth "scaffolding" the easiest way to create a new page template is to locate one in a theme, copy to a different file name, remove the code (or not, depending how drastic the new template will differ) and edit the template name in the header. Using wp-cli for this will probably take more time.

  • thanks for your answer, but I don't see wp-cli as totally server admin tools. Agreed that most of the commands are related to server administration of wordpress's core aspects. but at the same time, there are many commands which are relevant for wordpress's features. Jan 16, 2017 at 6:57

I agree with @MarkKaplun, but the scaffolding part is what may be improved in the future. For instance, I like the scaffolding of plugins, and I will test today scaffolding of Unit tests.

I think this scaffolding tool has the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.