I don’t know for some reason, the add_filter caused error. I used the following one:
function my_page_template_redirect()
{
if ( is_category( 'news-articles' ) ) {
$url = site_url( '/news' );
wp_safe_redirect( $url, 301 );
exit();
}
}
add_action( 'template_redirect', 'my_page_template_redirect' );
Related Posts:
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Preventing index.php?category_name=something from redirecting
- Add forward slash on categories url (serve one version of a url)
- Multisite blog converting categories to subdomains
- Optimal way to redirect home page to category archive?
- Redirecting specific category posts to subdomain
- How to: 301 Redirect /category/ to /customname/
- How to? Redirect /category/sci-fi/ to /category/scifi/?
- Redirecting category link to first child post
- Redirect category to first available child post
- Redirect category to url with /category
- Changing permalink from /postname/ to category/postname/
- WordPress category page redirects in .htaccess not working
- Why do my categories redirect?
- WP didn’t redirect to canonical category URL
- Sub Categories Keep Redirecting to Pages With Same Slugs
- redirecting from a general category page to another specific one
- Redirect single article permalink to paginated category page
- Automatically redirect a page to a category that share the same slug
- WordPress link to post links to category (loop)
- How to display post in custom file not in archive file?
- Use blog as base for tags and categories
- Category link redirect to custom template page instead of index.php?
- Redirect depending on category chosen
- Need help with major category and permalink re-organization
- Redirect Problems with Archive Page and GET variables
- OK to redirect the root WordPress category slug?
- How to prevent WordPress from redirecting single page to prefixed category archive with same name?
- Category pages redirecting to tab on Posts page grid
- Default URL for category dropdown select option
- WordPress Category url redirects to subdomain
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Paginations in Category Page Leads to Sample Pages
- htaccess redirect for all categories converted to tags now showing 404
- Page redirecting to category (IE only)
- Category Redirection Problem
- Can I set a default featured image for a category?
- How to list child categories in custom category template?
- Divi change project slug based on category
- WordPress MU 2.9.2 to 3.0.5 changes to category.php
- Keep active class in post page
- Are Custom Taxonomy Templates Possible?
- Remove Categories and Tags from Admin Dashboard
- Custom category link in wp_list_categories()
- Using widget logic I want to show only a widget on the archive page if there are no posts
- Why is this category page limiting the number of posts?
- Show all posts of sub category in a page like: foo.com/category/subcategory/ using UNCODE Theme
- Replace category titles
- Hide tag and category boxes from the post editor
- 403 forbidden on one page only
- how to remove category from database
- Add multiple=”multiple” attribute to categories dropdown
- Allow dot in wordpress permalinks (only for categories)
- Exclude category from Tag Template
- Exclude Posts From Specific Category from Next and Previous post links
- How would I go about adding custom header images per category?
- how to query posts and auto assign category if post title has keyword
- How to Add Default Content for all Category Pages Before and After Content?
- Show popular post by category code
- WordPress for Podcast Network
- Categories widget show empty?
- Exclude a category from a query that includes its parent category
- Count the posts number for every category
- Change of category structure will cause two kinds of URLs for one post
- Portfolio Filter Buttons Wont Work
- Woocommerce filter function not updating
- Get Meta Keys of Custom Categories
- Change slug of Standard wp Post category
- Hide a category of posts from main blog, and only show in category view
- ACF no print data [closed]
- Get the name of category in query
- Archive filtering
- Split multiple categories into two columns
- WooCommerce shared categories
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- How can I order all subcategories alphabetical independent of the parent categories?
- Add Catgory (assign) to Post Programmatically (without editing)
- Linking to the most recent post in my podcast category
- How to select a parent category and show the children to choose in another select?
- How can I display categories on different pages
- How to add excerpt and read more button to category archive page
- Icon images across multiple categories
- custom browse by
- Use different file includes for single.php
- How to get related category/categories in WordPress archive page
- Adding a button to a product if it’s in a category, then linking to that category
- Pages with posts filtered by category
- how to get number of posts in a category on a specific date
- How to add all categories into an array and extract the categories names and use it with a custom meta box
- Using pagination with multiple loops causes it to break
- Query posts that have all the specified tags
- How can I show page per category in wordpress? (Yes, category by page!)
- Why does my category page display “posted on…” when all I want it to do is display categories?
- Remove category number fill
- Fetch all categories from database
- Get categories by title descendant
- Hide categories from authors
- Update/change category of a post when it’s been inactive for a certain number of days
- wordpress category rewrite rule with pagination