• Resolved southcast

    (@southcast)


    Hey guys, I have a couple hundred of posts and working on individual settings for each of these posts-pages will take me ages. I would like to disable-enable a few plugins on and off in a single go, what would be your suggestion for a best way to achieve this with a single action ?

    Second question, I have a plugin I would like only to load on one particular post-type. Is it possible to achieve this with a single action. Please let me know how do I do this?

    P.S – Currently I have “Selective Plugin Loading” set as Enabled and I must say that the Plugin is incredible.

    https://www.ads-software.com/plugins/plugin-organizer/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Sterup

    (@foomagoo)

    I assume you know there is a global plugins page where you can disable a plugin for all posts. With that said you can do a little sql to set the same settings on all posts. Set the plugins the way you want on one of your posts. Then go to your database and find the _PO_ meta keys.

    SELECT * FROM wp_postmeta WHERE post_id = 12 and meta_key like ‘\_PO\_%’

    You need to change the post_id to whatever your post_id is and the table name to whatever your table name is for postmeta. If you haven’t changed the table prefix and you aren’t running multisite it will be wp_postmeta. Then you just need to copy the meta_keys and meta_values and enter them as new rows for the post IDs you want to set them on. If you want to get a list of all post_ids that are of post post type then you can do this query.

    SELECT ID FROM wp_posts WHERE post_type = ‘post’

    Thread Starter southcast

    (@southcast)

    Hey Jeff, Yes I am aware of the global disable/enable page. The scenario is, I have this one plugin globally disabled as it was loading across all the ‘pages’ and ‘archives’ pages. But now I needed it to load across all the posts. Hope that was clear.

    I run a single wp-install and haven’t changed the wp_prefix, so my table name is ‘post_meta’. I lost the track when you said Then you just need to copy the meta_keys and meta_values and enter them as new rows for the post IDs you want to set them on. May I make it clear again that I need this query to effect all posts at one go (as I mentioned earlier, making changes on each of them will be a nightmare).

    I am providing below, the relevant meta_keys and respective meta_values I have retrieved from the phpmyadmin.Based on the given info I hope you will be able to suggest me a proper and complete sql query. Very new to php here, thanks.

    1. meta_value : a:1:{i:0;s:49:"jw-player-plugin-for-wordpress/jwplayermodule.php";}
    1. meta_key   : _PO_enabled_plugins
    
    2. meta_key   : _PO_disabled_plugins
    2. meta_value : a:0:{}
    
    3. meta_key   : _PO_affect_children
    3. meta_value : 0
    Plugin Author Jeff Sterup

    (@foomagoo)

    There isn’t a single sql query to insert everything you need. You will need to create a bunch of sql queries to accomplish what you want with a little manual labor involved. Unless all of your posts have a similar url. Then you could create a plugin filter to accomplish what you want.

    Thread Starter southcast

    (@southcast)

    For those stuck in a similar situation. Selective Loading plugin did exactly what I needed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ideal way to enable or disable across all posts at once’ is closed to new replies.