Logout without confirmation and SAME window on mobile

Try using wp_redirect($url). See https://developer.wordpress.org/reference/functions/wp_redirect/ . So…something like: // set up the URL to redirect to $redirect_to = ‘https://www.example.com/page’; wp_redirect($redirect_to); exit; Note that exit is required to close out the code. See the docs in the above link.

W3 Cache redirects to front page when I press purge all caches

It’s because you have set the Referrer Policy header incorrectly set in the W3TC page cache. Referrer Policy This header restricts the values of the referer header in outbound links. **Directive: same-origin** …will fix it. If your overall Directive is “same-origin” and you set the Referrer header to something different (such as “origin”), this error … Read more

Redirect non existing page to frontpage

You can use conditional tag is_404() and wp action hook to redirect whenever the page can not be found. functions.php add_action( ‘wp’, ‘se344018_redirect_404’ ); function se344018_redirect_404() { if ( is_404() ) { wp_redirect( home_url() ); // // wp_redirect( home_url(‘some/page-slug’) ); exit; } }

Keep subcategory grandson in slug

The problem is not with WordPress — it does generate the proper permalink, be the post assigned to just grandson or son and father. It’s just that for the latter, the “chosen” category could be either son or father, but not both — and if it’s son (which has a parent category), then the permalink … Read more

Redirect Main Home Page url to category URL without plugin

You can use the following code: add_action( ‘request’, function( $request ){ if( empty( $request ) ){ wp_safe_redirect( get_home_url() . ‘/lunchtime-results/’ ); exit; } return $request; }); This can be added to your theme’s functions.php file. The code checks the current request arguments. When visiting the home page the request is empty; in all other cases … Read more