Exclude category
-
Hi, is it possible to exclude an entire category?
Thanks for your work
-
@marcorroma You can use the exclusion tab for that
I badly explained myself. I’d like to exclude all posts in a category, not the category page.
@marcorroma, as I said, You can use the exclusion tab for that. For example, let’s say that post URLs from a category are something like the:
https://www.example.com/category1/post1
https://www.example.com/category1/post2
https://www.example.com/category1/post3If You put only https://www.example.com/category1/, all posts from that category will be excluded.
If this is not the case, so I need a better explanation of what the issue is…
Hi, it doesn’t work.
The taxonomy of my permalink posts is http://www.mysite.com/article
The category taxonomy to be excluded is ww.mysite.com/exclude
If I exclude ww.mysite.com/exclude – nothing changes.
http://www.mysite.com/article is not excluded.
How can I solve it?
Thank you@marcorroma can you show screenshots of the configuration?
Sure.
Screenshot:
https://i.ibb.co/nBTBpmV/Schermata-2020-07-01-alle-16-01-21.png“SOCIETA” is name of category.
@marcorroma ok… now at the top there is a tab called excluded links, which is the tab where You can configure the options for excluded links. Can You take a screenshot of it?
Screenshot here:
https://i.ibb.co/C5vmLWt/Schermata-2020-07-02-alle-10-47-58.png@marcorroma hmmm… with that configuration you shouldn’t see the noopener and the no referrer on those links
Unfortunately I can’t exclude the category like this.
PS. my posts (of the category to be excluded) have this taxonomy: http://www.mysite.com/title-article
And they don’t have this taxonomy at http://www.mysite.com/category/title-articleCould this be a problem?
@marcorroma that’s the issue… If you don’t have anything that is common to all links that You want to exclude You have to add the links one by one to the exclusion list.
I understand.
I think it is something that some users may need to exclude guest post categories, for example.
If there are improvements keep me updated.
Thank you@marcorroma I will had this to our todo list in order for our team look in future updates.
Hi, do you have any updates for this feature?
I need to exclude all posts from a category automatically. Currently I have to enter each post id in the exclusions.
You could create an exclude function with a list of all available categories.
I’m waiting for your answer.
Thank’s for your job@marcorroma I don’t have a date for it. Anyway, If You are able to code You can make use of one of our hooks and do it by your self. Here you have an example:
add_action( 'wpel_before_apply_link', 'exclude_by_cat' , 10, 1 ); function exclude_by_cat($link_object) { $cat_id_to_ignore = array(1, 2, 3, 4); // Add cat ids you want to exclude $url = $link_object->get_attr( 'href' ); $post_id = url_to_postid($url); $category_detail=get_the_category( $post_id ); if (sizeof($category_detail) > 0 && in_array($category_detail[0] -> cat_ID, $cat_id_to_ignore)) { $link_object->set_exclude(); } }
If you have a minute, and haven’t done so, please leave a review. It’s what keeps support going. Thank you 🙏https://wordpress.org/support/plugin/wp-external-links/reviews/#new-post
- The topic ‘Exclude category’ is closed to new replies.