Can We Redirect Blocked URLs to Page of Choice?

[ad_1]

Yes you can download the BBQ Redirect plugin. Then open it and change the URL to whatever you would like. In the code (which is very simple) you will find the line that says “change this to any URL”. That’s what you’re looking for. Let me know if any questions about this.

Hi Jeff,

As always, thank you for your fast and stellar support!

Rather than installing your plugin, can you provide a code snippet (php code) that we can use instead?

From looking at the plugin’s php code, this appears to be the answer:

function bbq_header_1($header) {
	
return 'Location: '; // <-- change this to any URL
	
	
}
add_filter('bbq_header_1', 'bbq_header_1');

function bbq_header_2($header) { return ''; }
add_filter('bbq_header_2', 'bbq_header_2');

function bbq_header_3($header) { return ''; }
add_filter('bbq_header_3', 'bbq_header_3');

Can you confirm (or modify the above, if necessary)?

Thank you!

That is the correct code, but it must be run as a plugin. Adding the code via theme template will not work, due to firing order of WP hooks, etc.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer