WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
Archive title not being rewritten (29 posts)

  1. Peter vanDoorn
    Member
    Posted 8 months ago #

    I have noticed that the post archive title is not being rewritten and there is actually no setting in AIOSEOP to set what it should be anyway.

    I am using WooCommerce, which may or may not be part of the problem, but I can't disable it to test as it is providing the custom post type. The page that I noticed it on is the shop front page, which is basically just an archive page of the "products" post type.

    I tried changing the Use Original Title option, but it makes no difference what it's set to.

    Cheers

    http://wordpress.org/plugins/all-in-one-seo-pack/

  2. Peter Baylies
    Member
    Plugin Author

    Posted 8 months ago #

    Peter,

    There are options for setting titles for custom post type archive pages in the plugin; under Custom Post Type Settings, make sure you have Enabled "SEO for Custom Post Types" and "Enable Advanced Options"; check all the post types you want to use, and then check "Custom titles" as well, and you'll have options for setting the title format there. Also, it's possible to customize the title further using the aioseop_title filter.

  3. Peter vanDoorn
    Member
    Posted 8 months ago #

    Hate to contradict you, but there is no setting on my screen for custom post archives. Custom posts, yes, but not archives. Have a look at this screen grab

  4. Peter Baylies
    Member
    Plugin Author

    Posted 8 months ago #

    Peter,

    Sorry, you're right; I've been working on this, but of course none of that is in the plugin yet. For now, you would have to use the aioseop_title filter to do this, then.

  5. numero7
    Member
    Posted 7 months ago #

    I Peter, could you give some directions ? i'm actually facing the same problem with custom post type archive named "property"...
    I want to rewrite the archive page with the site name and some other infos.

    thanks a lot.

  6. Peter vanDoorn
    Member
    Posted 7 months ago #

    I'm running 2.1.2 of AIOSEO and it's still not fixed, so here's how I'm working around it. This requires getting your hands dirty and editing the header.php file, so won't be of help to you if you either don't know how, or don't have access to the theme files:

    1. In AIOSEO General Settings, set "Use Original Title" to Disabled
    2. In AIOSEO Performance settings set "Force Rewrites" to Disabled
    3. In the header.php file, find the code which starts with <title> and ends with </title> and replace it with:

    <title><?php if ( is_archive() ) { $postType=get_post_type(); echo $postType . " | "; bloginfo( 'name' ); echo " | "; bloginfo( 'description' ); } else { wp_title(''); }; ?></title>

    (note that this is hard-coding the title to how I want it - which is "page name | site name | site description" - so you might want to edit that to suit you.)

    Hope that's of help

    Peter

  7. Peter Baylies
    Member
    Plugin Author

    Posted 7 months ago #

    Peter,

    You shouldn't need to do that, either - here's how you can do this with the aioseop_title filter in All in One SEO Pack:

    add_filter( 'aioseop_title', 'peter_rewrite_custom_titles' );
    
    function peter_rewrite_custom_titles( $title ) {
        if ( is_post_type_archive() ) {
            $postType=get_post_type();
            $title = $postType . " | " . bloginfo( 'name' ) . " | " . bloginfo( 'description' );
        }
        return $title;
    }
  8. numero7
    Member
    Posted 7 months ago #

    Thanks a lot !!!! i imagine that i can target a specific archive type by putting the name within the : if ( is_post_type_archive('property') )
    for example...

  9. Peter Baylies
    Member
    Plugin Author

    Posted 7 months ago #

    numero7,

    Yes, you can do that as well, as per the Codex.

  10. Peter vanDoorn
    Member
    Posted 7 months ago #

    Thanks Peter. I did wonder about the aioseop_title filter, but couldn't find any documentation, so I just decided to hack it the direct way!

    numero7 - the filter method should go in your functions.php file (sorry if you knew that already ;-) )

    Both methods write the post type into the title using get_post_type() so you might not need to do any further targeting.

    Hopefully though, both methods will soon be redundant - eh, Peter? :-)

  11. Peter Baylies
    Member
    Plugin Author

    Posted 7 months ago #

    Indeed, it's in the works; but until then, happy hacking!

  12. numero7
    Member
    Posted 6 months ago #

    Hi what about the description ? I'm trying also to rewrite the description in my post type archive because actually I cant control what google takes on my page to fill the description field.

  13. douginbrooklyn
    Member
    Posted 6 months ago #

    Is there an update on this? I am having the same issue with a WooCommerce install where the main page for the store is title Publications but the page title is shown as Products. I would like this page to have a title of Publications.

  14. wpsmort
    Member
    Posted 6 months ago #

    Hi douginbrooklyn,

    This functionality is currently in testing prior to release. We hope to release in the next week or two at most.

  15. douginbrooklyn
    Member
    Posted 6 months ago #

    Awesome - thanks!

  16. Matthew Fries
    Member
    Posted 6 months ago #

    Looking forward to this too! You guys are great.

  17. jery61007
    Member
    Posted 5 months ago #

    been itching my head and tried wp_title filter but didn't work. sigh ! finally got it, needed to use the aioseop_title filter. Thanks :)

  18. EntBuddha
    Member
    Posted 5 months ago #

    Will this hack work for changing the paged format for custom post type archives?

    I just want our custom review post archive pages to follow the same format as other paged items such as categories. So something like this - Part %page%

    What would I need to change in the hack to accomplish this?

    Thanks,

  19. jery61007
    Member
    Posted 5 months ago #

    @EntBudha you can use this code to get that done, make changes to the code based on your needs

    add_filter('aioseop_title', 'change_gadget_title', 10, 2);
    function change_gadget_title( $title ){
    
            global $paged, $page;
    
              $site_name = get_bloginfo('name');
              $sep = '|';
    
        if( is_post_type_archive('CUSTOM_POST_TYPE') ) {
    
             $title =  $title.' '. $sep .' '. $site_name;
    
             if ( $paged >= 2 || $page >= 2 ) {
    		$title .=   sprintf( __( ' - Part %s' ), max( $paged, $page ) );
             }
        }
    
        return $title;
    
    }
  20. EntBuddha
    Member
    Posted 5 months ago #

    Thanks jery61007! I'll give it a try and report back.

  21. EntBuddha
    Member
    Posted 5 months ago #

    wpsmort,

    Any update on when this functionality will be baked into the actual plugin? I would much rather have it be part of the plugin than have to hack up the functions.php file, but if it's going to be another few weeks or months I'll have to use the hack so GWT doesn't keep flagging duplicate titles.

    Thanks

  22. wpsmort
    Member
    Posted 5 months ago #

    Hi EntBuddha,

    We hope to complete the testing this week and release next week.

  23. fromenglandwithlove
    Member
    Posted 4 months ago #

    Can I ask why it's taken you so long to add this to the actual plug-in?

  24. Matthew Fries
    Member
    Posted 4 months ago #

    BTW - I couldn't get Peter's hook to work exactly the way he shared it. Just changed it slightly and got it working:

    add_filter( 'aioseop_title', 'mf_rewrite_custom_titles' );
    
    function mf_rewrite_custom_titles( $title ) {
        if ( is_post_type_archive() ) {
            $post_type = get_post_type_object( get_post_type() );
            $blog_title = get_bloginfo();
            $title = $post_type->labels->name . " | " . $blog_title;
        }
        return $title;
    }

    Hope that helps.

  25. EntBuddha
    Member
    Posted 4 months ago #

    wpsmort I installed the latest version, but don't see an option for this functionality anywhere. Our custom post type archive pages still use the same title for each page which is giving us duplicate posts warning in GWT.

    http://www.entertainmentbuddha.com/reviews/

    On each new archive page I want the title to get rewritten like it does for all other archives using this setting - Part %page%

    Ideally it should behave like this second page of a standard category archive.

    http://www.entertainmentbuddha.com/category/gaming-news/page/2/

    I would rather not hack up the functions.php file to do so, because I thought you said this function would be baked into the latest release. Please advise on what I may be missing, or if this functionality didn't make it into the latest release.

    Matt

  26. wpsmort
    Member
    Posted 4 months ago #

    Hi Matt,

    We've not released any support for custom post type archives yet, its still in testing.

  27. EntertainmentBuddha
    Member
    Posted 1 month ago #

    wpsmort I see that the latest update still doesn't address my issue. will this ever be implemented, or do I have to use one of the user generated hacks above?

  28. wpsmort
    Member
    Posted 1 month ago #

    Hi Matt,

    This is scheduled for release in All in One SEO Pack Pro version 2.3.3 which will be released in August.

  29. EntertainmentBuddha
    Member
    Posted 1 month ago #

    wpsmort, thanks for the update!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.