• Hello!
    I know there are some other similar questions. But I can’t really extract a solution from them for my problem.

    The plugin works great and displays posts on all posts I can see (there are a lot of them I didn’t check them all). but now my client published a new post and there the [crp] doesn’t produce any output.

    I installed the Query Monitor Plugin, but don’t know what to do with it. I can’t find a difference on the posts where [crp] functions and on the one it doesn’t work.

    I also reseted the plugin options, that didn’t help either.

    When I insert a specific post in the CRP-Box in the post-edit-page, it works. but that’s not an option, it’s important that the related posts appear automatically.

    Can you help me with this?

    Thank you, Angie.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Ajay

    (@ajay)

    Thanks for the detailed checking and debugging.

    Can you please disable the inbuilt CRP cache if you’re using it – this will allow for the non-cached queries to show up similar to the last screenshot on this page – https://webberzone.com/support/knowledgebase/debugging-with-query-monitor/

    If the manual box (as you mentioned) above displays it means that the plugin is giving out an output but not necessarily finding related posts which is what we need to check.

    Thread Starter angiepunkt

    (@angiepunkt)

    Hi Ajay,
    thank you for the quick response!

    The first two checkboxes on the general tab in the crp plugin settings page are not ticked. Is this what you mean?

    The Query Monitor then produces this (but I’m not sure, if I’m doing this right):

    41	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'medium_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0005
    42	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'large_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0004
    43	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'ald_crp_settings'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0003
    Total: 3 / 167
    Plugin Author Ajay

    (@ajay)

    Correct on the caching. On query monitor, what you’ve given me is correct, but it looks like only 3 queries are from CRP which is very strange.

    If you navigate to a page that actually shows the posts, you’ll notice more queries and in particular one that comes via WP_Query->get_posts() like the last photo on the above link.

    If you’re not seeing it on the page, it means the plugin isn’t getting called to display the posts.

    This makes me wonder if there are any exclusion settings in place that’s breaking it down – can you check what’s under the Output tab -> exclusion settings to see if anything is there?

    Also check the meta box (same as were you put the manual posts) that nothing was checked there for this new post your client added.

    Thread Starter angiepunkt

    (@angiepunkt)

    Hi,
    Sorry, didn’t look into this for some time. Thank you for your answer.

    On a post where posts are shown the query monitor shows also only three queries (and not WP_Query->get_posts():

    41	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'medium_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0026
    42	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'large_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0002
    43	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'ald_crp_settings'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts 	0 	0,0002

    This is the posts url (the one where it works):
    https://wide-netzwerk.at/wide-update-gender-und-mobilitat/

    What can be the reason for this?

    Where can I find the Output tab?

    Thank you, Angie

    Plugin Author Ajay

    (@ajay)

    Hi @angiepunkt

    I’m confused by the outputs – I can clearly see the plugin working on the link above and not working on the previous link.

    The outputs tab is in the Settings page which you can access via Settings > Related Posts in your admin.

    Can you also check the General > cache settings are off.

    Then visit both those links – the one that works and one that doesn’t and check the Query Monitor outputs. Like the last screenshot in the tutorial above.

    What you pasted is only a subset unfortunately and not the main query.

    Thread Starter angiepunkt

    (@angiepunkt)

    Hello!
    thank you for your reply.

    On the output-tab of CRP settings I have only excluded pages, attachments and events from display, the field “Exclude display on these posts” is empty, also the field “exclude on Categories” is empty.

    Genereal > cache: Both boxes are not selected.

    Now I found more in the query monitor: For this post: https://wide-netzwerk.at/wann-ist-ein-mann-ein-mann/

    24	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'medium_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0003
    25	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'large_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0001
    26	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'ald_crp_settings'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0002
    150	SELECT t.*, tt.*
    FROM wp_mnvyjlnxyo_terms AS t
    INNER JOIN wp_mnvyjlnxyo_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    INNER JOIN wp_mnvyjlnxyo_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN ('category', 'post_tag')
    AND tr.object_id IN (2485)
    ORDER BY t.name ASC	
    
        WP_Term_Query->get_terms()
    
    	Plugin: contextual-related-posts	4	0,0009
    151	SELECT term_id, meta_key, meta_value
    FROM wp_mnvyjlnxyo_termmeta
    WHERE term_id IN (97,102)
    ORDER BY meta_id ASC	
    
        update_meta_cache()
    
    	Plugin: contextual-related-posts	2	0,0003
    152	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0003
    153	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:55:17' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2485)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (97,102,84,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	0	0,0041
    156	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0003
    157	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:55:17' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2485)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (97,102,84,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	0	0,0035
    158	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0002
    159	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:55:17' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2485)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (97,102,84,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('\"Wann ist ein Mann ein Mann?\"')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts

    and for this post: https://wide-netzwerk.at/wide-update-gender-und-mobilitat/

    24	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'medium_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0017
    25	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'large_crop'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0005
    26	SELECT option_value
    FROM wp_mnvyjlnxyo_options
    WHERE option_name = 'ald_crp_settings'
    LIMIT 1	
    
        get_option()
    
    	Plugin: contextual-related-posts	0	0,0001
    152	SELECT t.*, tt.*
    FROM wp_mnvyjlnxyo_terms AS t
    INNER JOIN wp_mnvyjlnxyo_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    INNER JOIN wp_mnvyjlnxyo_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN ('category', 'post_tag')
    AND tr.object_id IN (2475)
    ORDER BY t.name ASC	
    
        WP_Term_Query->get_terms()
    
    	Plugin: contextual-related-posts	3	0,0009
    153	SELECT term_id, meta_key, meta_value
    FROM wp_mnvyjlnxyo_termmeta
    WHERE term_id IN (99)
    ORDER BY meta_id ASC	
    
        update_meta_cache()
    
    	Plugin: contextual-related-posts	1	0,0003
    154	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0003
    155	SHOW FULL COLUMNS
    FROM <code>wp_mnvyjlnxyo_posts</code>	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	23	0,0005
    156	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:56:49' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2475)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (99,85,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	5	0,0075
    157	SELECT t.*, tt.*, tr.object_id
    FROM wp_mnvyjlnxyo_terms AS t
    INNER JOIN wp_mnvyjlnxyo_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    INNER JOIN wp_mnvyjlnxyo_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format')
    AND tr.object_id IN (1795, 815, 808, 790, 788)
    ORDER BY t.name ASC	
    
        WP_Term_Query->get_terms()
    
    	Plugin: contextual-related-posts	15	0,0010
    158	SELECT post_id, meta_key, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE post_id IN (1795,815,808,790,788)
    ORDER BY meta_id ASC	
    
        update_meta_cache()
    
    	Plugin: contextual-related-posts	50	0,0005
    161	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0003
    162	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:56:49' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2475)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (99,85,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	5	0,0057
    163	SELECT post_id, meta_value
    FROM wp_mnvyjlnxyo_postmeta
    WHERE <code>meta_key</code> = 'crp_post_meta'	
    
        apply_filters('crp_exclude_post_ids')
    
    	Plugin: contextual-related-posts	0	0,0004
    164	SELECT wp_mnvyjlnxyo_posts.*, MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität') as score
    FROM wp_mnvyjlnxyo_posts
    LEFT JOIN wp_mnvyjlnxyo_term_relationships
    ON (wp_mnvyjlnxyo_posts.ID = wp_mnvyjlnxyo_term_relationships.object_id)
    WHERE 1=1
    AND ( wp_mnvyjlnxyo_posts.post_date <= '2021-04-13 17:56:49' )
    AND wp_mnvyjlnxyo_posts.ID NOT IN (2475)
    AND ( wp_mnvyjlnxyo_term_relationships.term_taxonomy_id IN (99,85,31) )
    AND wp_mnvyjlnxyo_posts.post_type = 'post'
    AND ((wp_mnvyjlnxyo_posts.post_status = 'publish'
    OR wp_mnvyjlnxyo_posts.post_status = 'inherit'))
    AND MATCH (wp_mnvyjlnxyo_posts.post_title) AGAINST ('WIDE-Update: Gender und Mobilität')
    GROUP BY wp_mnvyjlnxyo_posts.ID
    ORDER BY wp_mnvyjlnxyo_posts.post_date DESC
    LIMIT 0, 5	
    
        WP_Query->get_posts()
    
    	Plugin: contextual-related-posts	5	0,0047
    Total: 14 / 185	0

    I hope this is the information you meant.

    angie.

    Plugin Author Ajay

    (@ajay)

    Thanks @angiepunkt

    This is what I wanted. From what I can see the queries are fine. But, it looks like the case of the first one where no posts are visible is because the plugin can’t find posts – I see two potential things to do. Try either of the two or both if either doesn’t help.

    1. In the list tuning tab add the option to Match Content as well as Title
    2. Check if you have “Only from same” category/tag enabled in the General tab. I think – if so, check if disabling help.

    • This reply was modified 3 years ago by Ajay.
    Thread Starter angiepunkt

    (@angiepunkt)

    Hello Ajay,
    [For your info: my mistake was that I didn’t view the post in the frontend… Thats why the output of the monitor was so limited.]

    Ok, with these two settings I get results on the post. So that’s a good first step. the case is this: without enabling the option “Match Content als well as Title” no posts are shown on this particular post.

    And: the “Only from same” (in my case category & tag, NOT matching all taxonomies) boxes don’t seem to have an effect at all.

    >> I fear my client won’t be happy with this, as it was the explicit wish, that the related posts only come from the same category or tag. And I still don’t understand, why no results are shown. The post has two categories and two tags activated. I looked it up, CRP should have much more than the 5 wished for posts to show.

    What can be the reason for this?

    Or maybe I understand the option “Only from same” wrong?
    If you have checked only from same tag, and the single post has the tags “animals” and “zoo”. > do only posts show, that have this same combination of tags?

    This could be a reason for posts not showing. But I thought, that the checkbox below “Match all taxonomies” solves this and means: if not disabled, take any post that has any of the same tags OR categories.

    So maybe I’m understanding something wrong here.

    Thank you for your patience!
    Angie.

    Plugin Author Ajay

    (@ajay)

    If you keep the Only from and select Category and Tags checkboxes, it will pick up any related posts that fall in any of the same categories or tags of the current post.
    Selecting Match all is severe as it needs both the category and tag to match so is better left unchecked.

    What happens if you select the Match content checkbox. Does it help get the posts even if you keep the Only from checkboxes enabled? If that works – then nothing like it.

    Another option is to disable the content matching which is the second-last checkbox on the List tuning tab – but that’s usually ideal for custom post types.

    The last option for this particular post could be to do the manual posts option i.e. adding the post ids that you think are relevant in the Contextual Related Posts meta box in the Edit post screen

    Thread Starter angiepunkt

    (@angiepunkt)

    Let me rephrase:

    So my initial settings were:
    – Only posts from categories and tags acticated
    – I NEVER had the Match all checkbox activated
    – match content checkbox was not activated.

    >> with these settings no related post displayed in this one post (well I didn’t check all 200 posts…)
    >> but this is what I don’t understand. It should display related posts with this! Because there are severals posts with the same tags and categories! But it doesn’t.

    Now I have the same settings like above, but activated the match content checkbox.
    >> It shows posts, but not the right ones! They don’t match any of the categories or tags.

    For this I still need a solution.

    Thank you, Angie.

    Plugin Author Ajay

    (@ajay)

    Angie, do you have still have the “only posts from categories and tags” selected. So what the settings should be are:

    – Only posts from categories and tags acticated
    – Match all checkbox remains deactivated
    – match content checkbox activated

    Thread Starter angiepunkt

    (@angiepunkt)

    Hello,
    Yes, these are my settings. Still, the “Only posts from same categories and tags” doesn’t have effect.
    There are posts showing, but they don’t match specifically the categories or tags.

    I also tried with and without “disable contextual matching”. But no effect.

    Plugin Author Ajay

    (@ajay)

    That’s strange – with the three settings as per my post above can you find me the correct mySQL queries? These need to have the “MATCH” clause in the query.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Posts not showing on new post’ is closed to new replies.