help with getting to work
-
Hello,
I’m at a total loss. I’ve had CRP running on my site for a few years, but I’ve never really gotten it to work the way I think it should be working. I want it to show related posts based on tags, but it only shows based on title. I’ve tried every possible combination in the setting, but either shows nothing at all or only posts that have common words in the title. I’m assuming that the number of tags don’t matter as long as they share at least one (“Limit content to be compared” set to “0”). What am I doing wrong? Please help!
Thanks,
Josh
-
The the way the algorithm works is that it first checks for relevance and then restricts that based on tags.
You do have two settings in the List Tuning that allow you to turn off the contextual matching. But, you will then need to, which I suspect you have, turn on the matching with the tags.
Ajay, thanks for the quick response. I have definitely tried this. Any other suggestions would be very welcome. I like how CRP looks on my site, and I really want to make it work the way I was hoping, but right now, it’s still only pulling from the titles, so if there’s no other title with matching words, there are no related posts showing.
I’m happy to share my settings and screenshots if that helps.- This reply was modified 1 year, 1 month ago by Josh.
Yes please that would be helpful. But, ideally can you check with Query Monitor plugin to see what queries are being generated by the plugin?
I’m sorry…I don’t know what query monitor is. In the meantime, it suddenly seems to be working. As I went through and jotted down all the settings, I made a few changes, and now it definitely seems to be working…until I try to exclude terms. Is there a limit to how many you can exclude? If I do one or two, it works, but when I try to do all the ones I want (39 right now), it stops working again.
At least we’re making progress ??Do you have the cache enabled by any chance? If so, can you disable it and clear it from the Tools page button?
https://webberzone.com/support/knowledgebase/debugging-with-query-monitor/
Above is a tutorial on using Query Monitor for my plugin. There shouldn’t be a limit on number of exclude terms unless it’s a part of WP_Query which I’ll be honest I’m not aware of.
I did have the cache turned on, and now turned it off and emptied the cache. Everything seems to be working fine either way (with or without the cache) until I put my list of tags to exclude in List Tuning. Then I lose related posts on specific posts where it was before the exclusions were added.
Below are my settings and the query results- General
- Cache posts only – unchecked
- Cache HTML output – unchecked
- Automatically add related posts to – all unchecked
- Display location priority – 999
- Insert after paragraph number – -1
- Disable on mobile devices – unchecked
- Disable on AMP pages – unchecked
- Delete options on uninstall – checked
- Delete FULLTEXT indices on uninstall – checked
- Delete FULLTEXT indices on deactivation – unchecked
- Show metabox – checked
- Limit meta box to Admins only – unchecked
- Link to Contextual Related Posts plugin page – unchecked
- List Tuning
- Number of posts to display – 6
- Related posts should be newer than – 0
- Order posts – Randomly
- Randomize posts – unchecked
- Related posts based on title and content – checked
- Limit content to be compared – 0
- Post types to include – post
- Limit to same post type – unchecked
- Limit to same author – unchecked
- Limit to same primary term – unchecked
- Only from same – Categories, Tags
- Match all taxonomies – unchecked
- Number of common terms – 1
- Related Meta Keys – left blank
- Post/page IDs to exclude – left blank
- Exclude Terms – various terms
- Exclude Term Taxonomy IDs – 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,54,47,55,48,6,3,7,8,16,17,18,19,22,49,50,51,52,53,24,25,26,1,30
- Disable contextual matching – checked
- Disable contextual matching ONLY on attachments and custom post types –unchecked
- Output
- Heading of posts – <h3>Related Photographs</h3>
- Show when no posts are found – Display custom text (this is temp for texting)
- Custon text – No related photographs found
- Show post excerpt – unchecked
- Length of excerpt (in words) – 10
- Show date – unchecked
- Show author – unchecked
- Show primary category/term – unchecked
- Limit post title length (in characters) – 60
- Open links in new window – unchecked
- Add nofollow to links – unchecked
- Exclude display on these posts – blank
- Exclude display on these post types – all unchecked
- Exclude on Terms – blank
- Before the list of posts – <ul>
- After the list of posts – </ul>
- Before each list item – (one space)
- After each list item – (one space)
- Thumbnail
- Location of the post thumbnail – Display only thumbnails, no txt
- Thumbnail size – crp_thumbnail (150×150 cropped)
- Thumbnail width – 150
- Thumbnail height – 150
- Hard crop thumbnails – checked
- Generate thumbnail sizes – checked
- Thumbnail meta field name – post-image
- Get first image – checked
- Use default thumbnail? – checked
- Default thumbnail – /wp-content/plugins/contextual-related-posts/default.png
- Styles
- Related Posts style – Grid
- Feed
- Number of posts to display – 6
- Show post excerpt – unchecked
- Loation of the post thumbnail – Do not display thumbnails, only text
- Thumbnail width – 250
- Thumbnail height — 250
SELECT
option_value
FROM
wp_options
WHERE
option_name = 'medium_crop'
LIMIT
1
get_option()
SELECT
option_value
FROM
wp_options
WHERE
option_name = 'large_crop'
LIMIT
1
get_option()
SELECT
option_value
FROM
wp_options
WHERE
option_name = 'ald_crp_settings'
LIMIT
1
get_option()
SELECT
DISTINCT t.term_id
FROM
wp_terms AS t
INNER
JOIN wp_term_taxonomy AS tt
ON
t.term_id = tt.term_id
INNER
JOIN wp_term_relationships AS tr
ON
tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE
tt.taxonomy IN ('post_tag')
AND
tr.object_id IN (2275)
ORDER
BY t.name ASC
WP_Term_Query->get_terms()
SELECT
post_id, meta_value
FROM
wp_postmeta
WHERE
meta_key
= 'crp_post_meta'crp_exclude_post_ids()
SELECT
wp_posts.ID
FROM
wp_posts
LEFT
JOIN wp_term_relationships
ON
(wp_posts.ID = wp_term_relationships.object_id)
WHERE
1=1
AND
( wp_posts.post_date <= '2023-10-24 10:18:08' )
AND
wp_posts.ID NOT IN (865,2275)
AND
( wp_posts.ID NOT IN (
SELECT
object_id
FROM
wp_term_relationships
WHERE
term_taxonomy_id IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,54,47,55,48,6,3,7,8,16,17,18,19,22,49,50,51,52,53,24,25,26,1,30) )
AND
wp_term_relationships.term_taxonomy_id IN (397,658) )
AND
wp_posts.post_type = 'post'
AND
((wp_posts.post_status = 'publish'
OR
wp_posts.post_status = 'inherit'))
GROUP
BY wp_posts.ID
ORDER
BY wp_posts.post_date DESC
LIMIT
0, 18
WP_Query->get_posts()
All of this looks fine to me in the query. In your results above, Query Monitor will tell you how many posts it could find in the second last column (Rows).
You’ll see the post IDs that you’ve applied in the lines:
wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,54,47,55,48,6,3,7,8,16,17,18,19,22,49,50,51,52,53,24,25,26,1,30) )
This is limiting related posts to only these two categories, which I assume are the categories/tags of the post you are viewing? The question I have is, that you have a limiting to the same category, but why are you also excluding other categories? The way the query works is that if a post that falls within the below two but also falls in the above 39, will get excluded. So if you have a lot of these you’ll end up with no posts.
AND wp_term_relationships.term_taxonomy_id IN (397,658) )
Ajay, I’m just a noob on all of this. What I was trying to do was exclude a bunch of tags so the update didn’t look at those tags when it was looking for related posts. I only have posts that I’m looking to have the update work. I have a ton of tags, but there are a bunch that I use for internal use (to create pages for instance) that I don’t want CRP to look at. That’s what the list of numbers is. I didn’t mean to limit it by anything else.
I understand. I suggest that since you’re limiting it to the same categories/tags, just leave it to that.
- The topic ‘help with getting to work’ is closed to new replies.