Not working disallow tags
-
Hi im using your plugin, thank you so much. i want disable related posts for some posts. And using tags for this.
http://prntscr.com/v7u61v from here, i choose tag after i cheek post but still i can see related posts.
im using <?php related_posts($post->ID); ?> this on single.php after post.
-
Hi @dieforyou, thanks for asking.
Question: do you mean you want YARPP to
1. exclude certain posts from “The Pool”, so they will never be included in YARPP’s suggests posts; or
2. not show related posts on posts with a certain tag?To do option 1: go to YARPP settings and check all the categories and tags you want YARPP to never suggest as related.
To do option 2: it depends on how you’ve set up YARPP to show related posts.
If YARPP is automatically displaying related posts for certain post types, add the HTML comment<!--noyarpp-->
to each post’s body.
If you’re usingrelated_posts()
in a theme file, you’ll need to use a PHP conditional to decide whether or not to show related posts. Egif(! has_tag('some_tag'){ related_posts($post->ID); }
Does that make sense?
Our apologies for the incorrect documentation, we’ll get that fixed!
Hi, thank you for answer.
my problem is 1.
http://prntscr.com/v8zdpf i choose a tag, from the pool for disallow.
But for example im looking a post have that tag what i choose. there is related posts working. i want cancel related posts that tag posts.
Ok thanks @dieforyou. I’m going to double-check it’s working for tags (as I realized I’ve actually just been testing for categories, which should be the same but maybe not) and that German text doesn’t cause issues.
In the meantime, can you provide me with the URL of a page having this issue? That may also help debug it.Hi @dieforyou ping! Would you be able to share your URL? Would love to get this resolved. jay at yarpp dot com if you prefer not sharing here.
Hi, http://prntscr.com/ve9ozd
http://prntscr.com/ve9pgbthis post have that tag, which one i choose for disallow: https://www.kisa.link/O6oM
Thanks @dieforyou. FYI I think I’m reproducing the problem with tags (although as I recall not with categories) so should have a solution soon…
I have a suggestion but I want to make sure I understand better before suggesting it…
I’m having difficulty understanding because I can’t see which posts use the tag “lgs cikmis sorular”.
1. Does https://testcoz.hangisoru.com/lgs-cikmis-sorular.html use that tag?
2. Does https://testcoz.hangisoru.com/2020-lgs-matematik-cikmis-sorulari-coz.html use the tag?Knowing that will help me be more certain about what you’re wanting.
Hi, sory for late answer.
1.https://testcoz.hangisoru.com/lgs-cikmis-sorular.html this url have lgs cikmis sorular tag. i just hide tags area but that post have this tag.
2.https://testcoz.hangisoru.com/2020-lgs-matematik-cikmis-sorulari-coz.html this url dont have lgs ciksmis sorular tag.
Ok thanks for the extra bit of information.
So, to clarify the situation right now is: https://testcoz.hangisoru.com/lgs-cikmis-sorular.html is NOT being recommended (in other words, YARPP never recommends it on other posts). BUT when you view that post, YARPP does show what other posts are related to it.
So YARPP is properly doing #1, “exclude certain posts from ‘The Pool’, so they will never be included in YARPP’s suggests posts” (that I tried to explain here). That is expected.
It is not, however, doing #2, “not show related posts on posts with a certain tag”. That is the expected behaviour. The FAQ ‘How can I prevent the “related posts” list from displaying on specific posts?’ is wrong: using the setting “Disallow by tag” or “Disallow by category” does NOT affect whether YARPP will add related posts to a post. It will only affects what posts can appear in YARPP’s related results.
So if I have post A, which uses tag “a”, and I set “Disallow by tag” and check “a”:
1. when viewing post A, YARPP will still add related posts to it
2. when viewing other posts, post A will never be suggested.So I think what you should do is add the HTML comment <!–noyarpp–> onto all the posts where you don’t want related posts to appear. It’s probably more work than using a tag, but that’s how YARPP currently works.
I will fix that that erroneous FAQ.
Does that make sense @dieforyou ?
- This reply was modified 3 years, 4 months ago by Michael Nelson.
Ok the FAQ was updated: if YARPP is set to automatically add related content onto posts, the only way to make an exception for a post is to add the HTML
<!--noyarpp-->
somewhere inside the post’s body. Using the “Disallow by tag” only prevents matching posts from being SUGGESTED. It doesn’t affect whether those posts will have related content appear on them.Please feel free to reopen this issue if there’s more to be resolved.
- The topic ‘Not working disallow tags’ is closed to new replies.