You can either add the following code to your functions.php
or create a custom plugin with the code.
function my_custom_page_redirect() {
if (is_page()) {
wp_redirect(home_url());
exit;
}
}
add_action('template_redirect', 'my_custom_page_redirect');
Note – change the URL in wp_redirect()
to whatever the ‘specificpage’ is. I just used home_url()
in the redirect as an example.
Related Posts:
- Redirect before post page
- 301 (static page instead latest posts)
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- WordPress 302 Redirect to Random Product/Post/Page
- Creating a redirect option for current page url
- Get current menu_order
- Get content from one page and show it on another page
- get_children() Not Working with orderby Parameter
- Post/Page Publish/Update button not clickable once I make an edit
- Custom Field in Featured image for A particular post
- Is there a WordPress equivalent to MediaWiki templates
- Getting an alphabetic post list with two letters onclick on letter
- Pagination not working on Custom Page Template
- Display most recent post in category instead of archive?
- Is it possible to show a different WP menu when using password protected pages?
- Multiple loops in same page, without duplicate content
- Include related posts on a page
- why does HTML Tag not working in Post and Page
- problem to delete page
- Phantom 302 status code when sending a POST requests on pages
- $post object is null
- Is there any WordPress alternative to Book module of Drupal?
- Convert a complex webpage into WP theme
- Posts are being redirected to xampp home page
- Why is WordPress redirecting users to random posts after commenting?
- Single post as homepage?
- Should a photo gallery be in a post or on a page?
- How can I pass the ID of a post to a page template by clicking a url?
- Multiple loops are not reset
- Why aren’t my posts/pages showing up in my WordPress Theme?
- Adding buttons to Add New Post and Add New Page
- Relative redirects for posts, categories, products and product categories
- Static posts page with home.php
- Using wp_list_pages() after calling query_posts()
- How do I Redirect a WordPress Page?
- Posts vs Pages and categories
- How to dynamically parse and transform post/page content before displaying it?
- Proper way of establishing custom landing pages in WordPress
- is_page Funtion for Posts ?
- WordPress Query Posts From Category Post on Static Page
- Intercept page request and add value to it
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- get_children returns older images
- the_content() Not Grabbing All Content
- Detecting current page from class method
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- I don’t want the complete article to show on homepage
- Change Author Name to Sitename on Frontend
- Display on page every post in blog WITH comments
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Link from Post to Another Post Via Clicking on Words within Original Post
- Link to older links
- Organization of time insensitive content
- Archieve page, Advertisement Every 3 Posts
- Prevent duplicate pages from being added
- What would causes search to return incorrect results?
- Separate blog and reviews categories
- Edit post & page option does not display on latest wordpress
- Custom Fields – How to get the list of a specific active widget each time it rendered
- How to show only homepage in google results instead of privacy, contact pages
- Google indexing duplicate page content with Page #### in post title and /page-2 in permalink instead of the ones I set
- Add CSS and JS files of the template post on a WordPress page
- Can’t find webpage on All Pages or All Post menus
- Show post count in custom taxonomy page
- How to show WP admin edit page within template page/post?
- Submit New Post
- Display all tags even if they are not assigned to a post
- how to put post customized in page
- Show code only on WooCommerce Pages
- Disable pagination in posts and pages
- How to redirect if is post edit or publish page?
- Very weird behaviour after removing WP pages
- Multiple Pages – Seperate blogs
- Category URL to use same string as Post URL Permalink
- Posts on Sidebar only
- Posts are not showing up on next page.
- How to give priority to page than to posts permalink structure?
- Hide Admin posts & pages in Dashboard
- structure of posts and pages
- Display only current page -> posts tags in page
- Call posts of particular category in a page
- Add wp-link-pages to post
- How to arrange different post categories in template
- How to mix pages and sub-categories in a url
- Make a custom URL and link to custom Template
- How to Post to Specific Pages?
- associate posts to a page
- 301 Redirecting posts without %postid% (just %post_name%) in permalink to ones with %post_name%_%postid%
- Woocommerce – custom post type of checkout page
- Posts and pages not getting published
- How to have more post in a page than in your home page
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- Cannot Create a new Post [closed]
- How can I use wp_after_insert_post with $current_screen?
- Edit Page button is gone