Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1102257

    Hi there,
    .
    is it possible to (bulk) enable the Advanced Layout Builder on a lot of pages?
    .
    Let me give you some context: we create a template page with the Advanced Layout Builder which we then convert back into pure shortcodes (using the Debugger). We then use a plugin to create a bunch of new pages from this one layout page, by duplicating the template page and slightly changing the content. The problem is that the duplicator plugin itself is not compatible with the Advanced Layout Builder, which is why we have to convert the template page into pure shortcodes and use the Classic Editor in the first place.
    .
    Long story short: we end up with a lot of pages that all have the Advanced Layout Builder disabled. So, is there a more efficient way to enable the Layout Builder on all of them without having to manually edit each and everyone of those pages? I am open for all kinds of suggestions, even database queries if there’s a faster way than enabling the Builder manually on each page one by one.
    .
    Thanks!

    • This topic was modified 4 years, 9 months ago by tixxpff.
    #1102304

    Hey tixxpff,
    As I understand your situation, taking the debugger shortcode and creating new pages by adding the shortcode via the Classic Editor is not the same as debugger to debugger. While this does “work” when opening WordPress will still view it as Classic Editor content.
    Opening each page and saving as an “Advanced Layout Builder” page should correct, but for a “bulk” save option, I have not found a solution.
    But I have assisted with a function that will automatically open each page / post in the Advanced Layout Builder, but if you have posts that you don’t want to be in the Advanced Layout Builder format, this may cause issues, so I’m not sure this is a “clean” solution. If you wish to try, Try adding this code to the end of your functions.php file in Appearance > Editor:

    
    function trigger_alb_on_load(){
    	?>
    	<script>
    	(function($){
    		$(window).load(function() {
    			$("#avia-builder-button").trigger('click');
    		});
    	})(jQuery);
    	</script>
    	<?php
    	}
        add_action('admin_head-post-new.php', 'trigger_alb_on_load');

    If you are going to select the correct pages and open to save, it may save you some time, but I wouldn’t recommend using this for a client as they may get confused when opening non-Advanced Layout Builder posts.
    I hope this helps.

    Best regards,
    Mike

    #1102460

    Hi Mike,
    thank you for trying to help! This will work as a temporary solution or at least make my life easier, while I keep looking for a permanent solution.
    .
    Do you think that a database approach could work? I wouldn’t mind manually running DB queries, if that’d work.

    #1103143

    Hi,
    Glad to hear. I would not recommend the database method as it could be risky.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Bulk Enable Advanced Layout Builder on pages?’ is closed to new replies.