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
- Sort results by name & asc order on Archive.php
- Default archive URL wordpress
- Increase number of posts in archive page
- How can I lock down an old wordpress install I don’t intend to update?
- How do I place content on archive pages but not on main page?
- Decreasing the Memory Consumption of a WordPress Site?
- Setting up custom post type archives in WP3.1? Any luck?
- WordPress Posts By Date/Day?
- How can I get posts in a subcategory to display on it’s parent categories archive page?
- Archive Listings Filtered by Date Values in a Custom Field/Post Meta?
- How can I get the Month Name from Archive?
- Preventing 404 error on empty date archive
- is_archive() returns false on the archives page
- What is archive.php used for?
- Archive by Year
- 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 visit archive-post.php?
- 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
- Create a month by month archive of pages (not posts)
- 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
- Making next_posts_link(); return posts by month
- Count posts for each year
- 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
- How can I get the ID for an archive page? [closed]
- How to translate month names in “Archives”
- if in_category on archive.php
- Archive in sidebar with dropdown list of Year – Month – Day
- Arrange and separate posts
- How can I organize/create an archive listing by Year and month
- Change behavior depending on content length
- Customize first page of category
- How to edit archive page’s content inside wordpress dashboard?
- Cache previous versions of website?
- 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?
- How can I get archives for specific category without category_base in the url?
- condition for only if is archive for default post type
- Custom Taxonomy Archive not displaying entries
- Show only post titles in archives?
- Remove author archive
- Preview Post/Custom Post types in Archive
- if there is only one post in the category, directly open
- How to hide a post from archives
- How to disable monthly archive
- Creating an Archive using a Custom Taxonomy
- Displaying year, month and day archives differently
- What’s wrong with my date_query?
- How we display Archives for specific categories
- 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?
- How to display data in archive page?
- Modify text after post count
- How to show year/month archive including months with no posts
- Displaying Archives List
- Archive links don’t work when clicked
- Query post for ‘selected category’ in archive.php
- Custom archives function
- Page is displaying blog archives
- terms_description and admin problem
- wp_get_archives() display months even if there is no posts
- date.php shows only three posts’ title. how to fix it?
- How to hide the year in archive link
- Show recent posts in single-post page
- Multiple posts categorized by day?
- How to edit wordpress post without republishing
- Archive by Year
- Exclude a specific category link from archive / front page
- Create archives by author role
- How can i display in themplate file only a few post
- How to create an archive section of a WordPress site
- A problem with date archives
- how to hide all posts under one category
- How to remove “Archives” after category name?
- Load new Posts on Scroll on Page
- Filter the post listing for a particular category from archive month list
- 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 have infinite scroll consider passed parameters?
- 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
- next/previous stays within specific taxonomy term when in single post
- Archive Pages Only Showing 1 Post from Caregory