%excerpt% shows only Picture title

#35802
  • Resolved Detlef
    Rank Math free

    I switched from wpseo to RankMath and having following issues:
    on the Page:
    https://derflammenwerfer.de/highlight-show-hochzeit/
    Settings are:
    Title: %title% %sep% xxxxx
    Page description: %excerpt%
    Result is:
    Title: Highlight – Show zur Hochzeit » xxxxxx
    Page description: Leuchtshow Hochzeit LED-Show

    Also some Page description looks like this (see sensitive Data): [inspic=354,left,fullscreen,180] Normal Text…

    Maybe important information is that this posts and pages with this problem are in “classic editor field” in Gutenberg Editor

    Anny Idea?

    Best regards

    Detlef

    • This topic was modified 4 years, 8 months ago by Detlef. Reason: Additional information
Viewing 10 replies - 16 through 25 (of 25 total)
  • Hello,

    Thank you for the reply.

    This is expected behavior, the filter will only display the custom description on the frontend.
    This will not affect your SEO since the preview is only for reference.

    I hope this info helps.

    Detlef
    Rank Math free

    But, (please help me if I’m wrong…) is it not normal to write a post for example like this?

    First Line: (If I would like to have something in the next Line, i press enter on my keyboard, right?)
    Second Line
    Third Line with more Text and maybe even more Text.

    My expected behavior for the Google description would be:

    First Line: Second Line Third Line with more Text and maybe even more Text.

    But it looks like this:

    First Line:

    OR like I would expect (with your code in my function.php):

    First Line: Second Line Third Line with more Text and maybe even more Text.

    BUT than I loose the visual control of the snippet preview what was the reason why I changed from wpSeo….

    • This reply was modified 4 years, 8 months ago by Detlef.
    • This reply was modified 4 years, 8 months ago by Detlef.
    • This reply was modified 4 years, 8 months ago by Detlef.

    Hi there,

    Thanks for the reply and sorry for the inconvenience.

    Could you please share a link where you are seeing this so that we can test this further?

    We are looking forward to helping you.

    Thank you.

    Detlef
    Rank Math free

    At the moment with your code in my function.php, you can see it in the backend of wordpress in all posts (please log in).
    You don’t have any visual control what description will be displayed in the snippet for Google because in the backend you see only the word “description”.

    https://derflammenwerfer.de/hochzeit-schweinfurt/

    If you want, I can disable your code is still in my function.php and than you can write a post (I wonder that nobody had yet the problem).
    Write a paragraph (one or two words), press enter, write something more…
    Snippetpreview (and google) shows you only the first paragraph (not depending how many words are in the post).

    Hi there,

    Thanks for the follow up.

    %description% is not a registered Rank Math variable and thus this should not be used.

    I have modified your code to this:

    add_filter( 'rank_math/frontend/description', function( $description ) {
    	return preg_replace('/\[inspic=.+?\]\s?/', '', $description);
    	
    });
    

    This seems to work for the test post.

    Please check and let me know if this is working as expected.

    Detlef
    Rank Math free

    Not important if your code is in the function.php or not it looks like this (your Test post)
    Strange is, that the overview in the posts is correct:
    https://www.dropbox.com/s/4gds3bhpmxq6yuo/rankmath3.png?dl=0
    But rankmath can not “read” it correctly:
    https://www.dropbox.com/s/ykb1ax5l6jryvwu/rankmath4.png?dl=0

    Is there than maybe a workaround to exclude the first paragraph if it contains the word Termin: ???

    Hi there,

    Thanks for the follow up.

    I have passed this on to our dev team for closer investigation and we will be getting back to you in a short while.

    We appreciate your continued patience.

    Todd
    Rank Math free

    Hi,

    I am afraid this is happening because you are using the image as the first thing in the post’s content. To get around this, please enter a meta description manually for the posts where you are using image as the first thing. To make sense of the meta description, we use the first image’s caption or the first paragraph of your content as the meta description. Otherwise, it wouldn’t make much sense in many cases if we combine content from multiple sections and use it as a meta description. That would confuse search visitors and make them unlikely to click on your search results.

    I am afraid this is not something that needs fixing as your particular use-case is very rare and you will either need to enter a manual description or use content instead of images as the first thing in your posts.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Detlef
    Rank Math free

    Ok, thank you very much to take your time and look into my rare usercase.
    Last question:
    Can I add any code to my function.php to exclude the word: Termin:???

    Thank you

    Hi there,

    Thanks for the reply.

    If you don’t want termin to appear as the description, the most efficient method be manually enter a description on the Rank Math metabox.

    I hope this info helps. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 10 replies - 16 through 25 (of 25 total)

The ticket ‘%excerpt% shows only Picture title’ is closed to new replies.