You could redirect anything that’s not a page or admin to home via the parse_query action:
function wpa_parse_query( $query ){
if( ! is_admin() && ! $query->is_page() ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'parse_query', 'wpa_parse_query' );
If it’s not an admin screen or a query for a page, it’ll redirect. You can see all of the types of pages this will remove under the Conditional Tags page in Codex.
Related Posts:
- Is each issue of a magazine site a static page
- How can I lock down an old wordpress install I don’t intend to update?
- Setting up custom post type archives in WP3.1? Any luck?
- WordPress Posts By Date/Day?
- How can I get the Month Name from Archive?
- What is archive.php used for?
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Archive widget – limit number of months to 12
- How do I make wp_get_archives show me months where only pages were created?
- Sort custom-posts in archive.php via meta-key?
- Including post_type = ‘wiki’ in author archives
- Output yearly archive within a page
- How to show specific year archive into dropdown list
- Archive filtering posts by year and month
- How to get the date dynamically from archive.php to date.php?
- How to make a custom Archive Page
- How can I change the way dates shown in the archive widget?
- display archive as collapsing links
- how do I get the date in a date archive page
- Arrange and separate posts
- How to edit archive page’s content inside wordpress dashboard?
- Archive pages for posts based on their taxonomy?
- front end publishing not working on front-end page
- How to show static placeholder when less post elements in archive page?
- Preview Post/Custom Post types in Archive
- if there is only one post in the category, directly open
- How to disable monthly archive
- When i try to open archive pages i get a 404 error
- View Private Published Page with URL Code (no login required)
- How to Create Custom Archive page
- Does only custom post type have post type archive pages?
- Modify text after post count
- How to show year/month archive including months with no posts
- Displaying Archives List
- Custom archives function
- Page is displaying blog archives
- terms_description and admin problem
- wp_get_archives() display months even if there is no posts
- how do I encode links to specific archive searches?
- Some archive by year page return 404
- If one taxonomy contains the same term as another then display post
- How to filter by date & a specific custom post type post-WP 4.4?
- Author archive doesn’t work [closed]
- Having a problem with Next and Previous Links
- Checking if a specific date archive is being displayed
- Wrap the “show_post_count” between div
- Is a list page usually called an archive page in WordPress?
- How can I use “getarchives_where” to get monthly archives for static pages?
- remove 2014 from wp_get_archives
- How can I make a page for post formats (specifically quotes) in wordpress 3.5
- Custom Post Type archive
- Archive page showing wrong month
- Archive subtitles for different types of archives
- How to Get The Excerpt of the page that displays Blog Posts
- Show title bar only on archives / hide it on all posts and pages
- Secondary WP_Query being overriden in archive page
- Custom Tags Archive – permalinks not working
- Is there a way to multiply archive loop results sequentially?
- Combining custom taxonomy posts with default posts on one archive page
- pre_get_posts conflict with archive posts
- Create a custom URL for blog archive
- Custom loop in addition to default on archive page
- Show Daily Archives after specific dates
- Custom archive pages without “the loop”
- Remove posts from two categories in Archive Page
- Show all 12 months regardless they have posts
- How to get the month argument from permalink in wordpress?
- Difference between $numpages & $max_page on archive pages
- Custom post archive page not opening 404 page
- How to disable date archives?
- Archive page no content to display
- Can I overwrite custom taxonomy FROM “public” TO “false”
- Simplest way to archive a WordPress (and take down)?
- I want to be able to access archives to see how recently a post has been read: How can I do that?
- How to prevent archiving and search engine caching in a free WordPress blog?
- How to Completely Remove Archive Title a.k.a the_archive_title?
- Display archives based in post_format
- Show archives as a drop-down in the main navigation menu
- What’s wrong with default posts archive?
- How do I add a count to each month in this archive code?
- Archives widget doesn’t work?
- Display Day names with wp_get_archives instead of date
- Display future posts in archive
- date.php shows only three posts’ title. how to fix it?
- Multiple posts categorized by day?
- Archive by Year
- Exclude a specific category link from archive / front page
- Create archives by author role
- A problem with date archives
- Load new Posts on Scroll on Page
- Show monthly or daily archives
- Create page like custom post type list in WordPress
- WP Archive & Category Pages not filtering
- List archive year – post by post
- WordPress 3.6 – archive.php doesn’t get triggered [closed]
- How to display the archive for native posts
- printing taxonomy and meta fields values
- If all posts have exactly the same publication date/time, to the second, what order are they listed in the main query?
- Archive dissapeared on dashboard
- change read more text in archive page depending on post category