• Hi,
    I am running WordPress in CLI / command-line mode, with the following :

    define('PATH_TO_WPLOAD', '/websiteroot/html/wp/wp-load.php');
    require_once(PATH_TO_WPLOAD);

    With this way, wp-load.php loads the “real” WordPress environment.

    Now, what I need is to prevent some plugins from loading, because I don’t need them in CLI mode and they consume a lot of memory.

    Is there an easy way to do that ?

    Thank you,
    Looic.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could either disable the plugins from the dashboard, or just remove them from the plugins directory.

    Thread Starter Looic

    (@looic)

    Hi,
    I cannot do that, because the same WordPress installation is also working behind Apache (for frontend users).

    So what I am looking is a hook or something like that, to specifically prevent plugins from loading when I call wordpress in CLI mode (so that the plugins continue to work when loaded with Apache).

    Here is a list of plugins with links to relevant docs:
    https://adambrown.info/p/wp_hooks/hook

    “plugin” appears in many of them, suggest seeing if any of them will do what you want.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to load WP in command-line mode without the plugins ?’ is closed to new replies.