WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Post title template %%tag%% commas? (11 posts)

  1. webcabbie
    Blocked
    Posted 1 year ago #

    Post title template %%tag%% commas?

    Hello I inserted Post title template %%title%%-%%tag%% as my post title template and its almost doing what I want but it is jamming commas in between the post tags..

    I rather not have them in there. Is there a way to remove them?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. tizz
    Member
    Posted 1 year ago #

    It would be useful deactivate all others plugins and activate default theme to see if this resolve the problem. If this works, re-activate current theme and plugins one by one until you find the problematic one.

  3. jrf
    Member
    Posted 1 year ago #

    @webcabbie, @tizz,

    Actually, this is done by WPSEO. In response to your issue, I've created a filter called 'wpseo_terms' which will allow you to filter the terms string.
    I've send in a pull request for this which should hopefully make it into the next release.

    Once this enhancement is included in the plugin and you've upgraded, the following code snippet will start working. You could add this to your (child-)theme's functions.php file:

    function terms_without_commas( $terms ) {
    	return str_replace( ',', '', $terms );
    }
    add_filter( 'wpseo_terms', 'terms_without_commas' );

    Hope this helps!

    Smile,
    Juliette

  4. tizz
    Member
    Posted 1 year ago #

    Actually, this is done by WPSEO

    Really? I don't have commas in my SEO plugin titles

  5. jrf
    Member
    Posted 1 year ago #

    @tizz: But are you using the %%tag%% variable (or the %%category%% one) in the titles ? and do you have more than one tag/category assigned to posts ?

    I looked in the code and in certain cases where more than one tag/category would be returned, they will be returned comma-delimited. The 'Help'-tab for SEO->Titles and Meta also acknowledges that the values returned are comma-delimited ;-).

    However, the initial advise you gave is absolutely the way to go for 90% of the issues reported here, as for a lot of them, WP SEO is not to blame, but the theme or another plugin which is doing it wrong. WP SEO is just an easy scapegoat in those cases ;-)
    So please, do keep giving people that advise!

    Smile,
    Juliette

  6. tizz
    Member
    Posted 1 year ago #

    are you using the %%tag%% variable (or the %%category%% one) in the titles ?

    Nope. I understand what you say now.
    At the moment I can't test it as I'd like, but I believe it's true what you say. In the end, WP by default also separates tags by commas, isn't it?

  7. webcabbie
    Blocked
    Posted 1 year ago #

    how soon is that update coming? I added the code already. Also do you do request work on other plugins? There is one I need modifications on.

  8. jrf
    Member
    Posted 1 year ago #

    @webcabbie, I expect that the updated release will be a few more weeks - Yoast is on holiday at the moment.

    And yes, I do (paid) request work on any and all plugins ;-) If you like, contact me via email @adviesenzo.nl.

    Smile,
    Juliette

  9. manulito
    Member
    Posted 1 year ago #

    After searching the web and finding no solution for my problem I think this thread is the right place to ask.
    For hours I'm trying to change my Post Types -> Title Templates but it is just not working: http://www.screencast.com/t/WnwRuKkVON5

    I can check or uncheck the force rewrite, but no effect. I tried different <title> in the header but still no effect:
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    and
    <title><?php wp_title(''); ?></title>

    I´m using the udesign theme and it comes with this default <title>
    <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>

    This is my website: Basketball-Camps-USA.de

    Hopefully someone can help!
    Thanks in advance & greetings from Cologne!

    manuel

  10. jrf
    Member
    Posted 1 year ago #

    @manulito - This is not the right place, your question is quite different from the one above. Please open your own thread.

  11. manulito
    Member
    Posted 1 year ago #

    Ok - thanks for the advise! I just opened a new thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.