put this code in functions.php file
add_action('wp', 'myfun');
function myfun(){
if(is_single()){
wp_redirect( home_url() ); exit;
}
}
hope this trick solve your problem. all the best 😉
Related Posts:
- Detecting post type within init action
- Force redirect not logged in user to (wp-login.php or wp-admin) for specific page
- ModSecurity && Admin Ajax: Server locking up
- Single page site + pushState?
- Ajax login without redirect/reload
- Get returned URL from wp_remote_post if response code is 302
- Load more posts (Ajax) in tabbed sidebar on single.php
- How to force the admin-ajax.php file to load over HTTPS?
- Usage of wp_send_json_success and wp_redirect at the same time
- How to cache json with wp-super cache
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Get Previous & Next posts by Post ID
- Nonces and Cache
- ajax – why multiple calls to wp_create_nonce() return same value?
- AJAX request on the frontend always returns 0 if user is not admin
- Passing variables through permalink structure
- Using ajax on categories and wordpress loops
- Cannot load admin-ajax.php. No access-control allow origin*
- Initialize JS with an ajax loaded ACF form
- How to redirect url requests to https? [closed]
- htaccess or redirect to cloak portion of a link?
- Nonces and Ajax request to REST API and verification
- Can’t seem to get wp_localize_script to work
- Why wordpress multisite redirect to wp-signup if site exists?
- Rewrite WordPress Custom URL
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- Custom rewrite rule
- WordPress AJAX calls not detecting language properly?
- AJAX issue – Uncaught SyntaxError when processing Zip File
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- update_user_meta doesn’t work with AJAX
- Using wp_handle_upload and media_handle_sideload with ajax
- htaccess 301 redirect http to https doesn’t work
- Use htaccess to redirect WordPress to static website in a subfolder
- Load ajax if is_home()
- Redirect from sub-directory to root – New WordPress 5.2.3 Set up
- How to know what page is calling admin-ajax.php?
- Populate a Map at The Same Time as showing Posts via AJAX
- wp_localize_script not working on ajax response
- How to redirect URL with subfolder to the same URL but without subfolder?
- Why Does WordPress not output admin-ajax.php path by default?
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Site loads very slowly (4-5 minute load time)
- 503 Service Unavailable error was encountered
- SSL and www to non-www redirection works only on homepage – WordPress
- SSO autologin WordPress + Ajax
- Wildcard forward all posts and pages with few exceptions
- Test WordPress api with postman
- How to handle 400 status in Ajax [duplicate]
- WordPress keeps redirecting subpages without http to https homepage after switch
- How to process wordpress ajax call without action parameter?
- Nonce fails on ajax save
- WordPress 4.4 old permalink redirect
- ReDirect subfolder link to another sub-folder and force SSL
- Multisite Subdomain Redirect Mask
- Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect
- All AJAX requests return a 400 error
- Unable to successfully verify nonce
- Create custom POST Method URL
- Getting a variable using $post ajax back from php to js response in WP
- WordPress ajax-action how to return content
- ajax form is returning the dreaded “[HTTP/1.1 400 Bad Request” and a zero
- How to check nonce lifetime value of plugins?
- How can I wp_send_json data?
- Making POST request with AJAX returns a 400 error (without jQuery)
- Load image src through Ajax by ID?
- PHP session when called wp_ajax_nopriv
- What exactly does ‘authenticated’ mean for wp_ajax_nopriv?
- How to redirect multiple subfolders back to root domain?
- How do I Redirect Tags from Old Joomla Site to New WordPress Site?
- How to make image in TinyMCE clickable
- How to use Jeditable plugin with admin-ajax.php?
- WordPress Ajax Not Firing
- Uncaught TypeError: Cannot read properties of undefined (reading ‘message’) [closed]
- Disabling ajax code that does a POST request that ends in a 400 error code
- WordPress /wp-admin redirect to wrong port in docker
- How to prevent my external API call from being called by anyone but me (my site)
- get a bad request 400 on my ajax-admin.php file
- WordPress site not forcing from http to https instead getting redirected too many times
- Registration form AJAX check for existing username (simple version)
- Trigger action via button
- Syntax error on query_vars while handling with Jquery
- Redirect HTTP request to HTTPS request
- Want to send ajax request in wordpress to a custom file in plugin
- How to send the checkbox value to email
- Sending email with wp_email and AJAX
- AJAX Call in Plugin Returns More than JSON
- Ajax take too long to return code
- Redirect A URL Pattern In WordPress Using .htaccess
- problem when adding wp_editor with ajax [duplicate]
- Get wp-load.php PATH with wp_localize_script and JavaScript for plugin
- Ajax Form seems to post, but does not return
- Ajax request to admin-ajax.php and window.location.href
- Why can wordpress not find the actions I add in my constructor?
- delete attachment for one post without deleting actual attachment post
- Memberpress isn’t cooperating with WooCommerce
- where does my function output from load-* go?
- Redirect a WP to another with all URL
- wordpress ajax bad request 400
- How to get Apache2 to redirect to a subdirectory