• Jackson

    (@aframeforward)


    Super weirdness I’d love some guidance on. I use Yoast Premium and have all category, etc pages set to no index via the plugin. However, Google keeps showing these odd category pages in the results.

    I thought I had this figured out after learning a cool hack from Yoast tech support where I would just use the Google Search Console “Inspect URL” function and then it would realize that the canonical for that page was the actual article and not the odd category page.

    That worked for a day and my new post shot up instantly from not ranking to the 2nd page of Google search results. I was pumped.

    But, I googled the keywords I was trying to rank for again today and low & behold it dropped from the rankings, only to find a weird category page ranking about 8 pages down the list.

    Background:
    I use Divi on WordPress.

    Here is the article/keywords I was trying to rank for “Laguna Beach Engagement Photo Locations” – [ redundant link removed ]

    Any ideas how I fix this? Thanks!

    • This topic was modified 4 years, 2 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    This isn’t a WordPress topic. At best it’s a Divi topic and that’s not supported on this site.

    You may want to ask on Google’s Webmaster’s forum instead.

    Thread Starter Jackson

    (@aframeforward)

    Thanks for the response Jan.

    Yoast told me it was a theme (Divi) issue.

    Divi (Elegant Themes) told me it was a WordPress pagination issue.

    I’ll post in Google and keep my fingers crossed. 🤞

    Thread Starter Jackson

    (@aframeforward)

    Here’s what Google is telling me…

    “Would agree that setting some sort of redirect on the URL would be good. Its clearly some sort of ‘mistake’ page. Looks like the ‘cat=’ forwards it to category listing page handler. but -1 is not a real category. So its then probably just trying to list all posts.  That particular post is the most recent post, but because it not really a ‘category’ page, it rendered by normal page handler, whch ends up putting in canonical etc.  Although perhaps even better would be to ‘fix’ wordpress, so this URL doesnt return content. A the most crude…  <?php if (isset($_GET[‘cat’]) && $_GET[‘cat’] == -1) {      header(‘HTTP/1.0 404 Not Found’);      exit;} 

    Or even better would be just the fix the code, as it clearly knows when a category doesnt existhttps://www.aframeforward.com/?cat=1232423523it should do exactly the same for -1In fact it seems does the same for anything <1, eg /?cat=-1232423523 gives the same duplicate.

    Possibly do something better than return no content, so that if users end up there it ok. But important is not to return the content of an actual page.  This is better than trying to ‘noindex’ the page, as it risks affecting real pages.”

    and…

    “Just for reference, I dug a bit in wordpress source. Seems it tries to support negative cat ids, to function as exclude filter  $cat_array = preg_split(‘/[,\s]+/’, $q[‘cat’]);
                            $q[‘cat’] = ”;
                            $req_cats = array();
                            foreach ( (array) $cat_array as $cat ) {
                                    $cat = intval($cat);
                                    $req_cats[] = $cat;
                                    $in = ($cat > 0);
                                    $cat = abs($cat);
                                    if ( $in ) {
                                            $q[‘category__in’][] = $cat;
                                            $q[‘category__in’] = array_merge( $q[‘category__in’], get_term_children($cat, ‘category’) );
                                    } else {
                                            $q[‘category__not_in’][] = $cat;
                                            $q[‘category__not_in’] = array_merge( $q[‘category__not_in’], get_term_children($cat, ‘category’) );
                                    }
                            }
     This is from wp-includes/query.php So that is what is being ‘shown’. All posts NOT in category 1! I would guess this is such little known functionality, that your theme, and perhaps even Yoast, is not ‘seeing’ it as a real category page. Hence yoast does not inject the noindex tag, and the rel=canonical is being created incorrectly.  (don’t have Yoast installed to check it source)”

    What do you make of this?

    Thanks!

    Jackson

    =D

    Thread Starter Jackson

    (@aframeforward)

    @jdembowski I’ve now thoroughly exhausted all options with Yoast, Elegant Themes, and the Google Webmasters Forum. They all point to it being a WordPress issue.

    None of them understand why these /?cat=-1 pages are being created and showing up in Google search results.

    We switched to the default WordPress theme and the issue still persists there, so that ruled out it being the Divi theme.

    They are all pointing me back to WordPress to find a solution. They have all advised that if WordPress won’t help with the issue then I could try to cheat the system and inject some code as suggested below with one of these two options:

    1. From Google Webmasters Forum – “Fix the ‘negative’ category URL, and it will fix all the pages at once:

    Looking a bit more, seem the correct way to triger 404, is like
    https://stackoverflow.com/questions/13125169/wordpress-trigger-404

    <?php
    if (isset($_GET[‘cat’]) && $_GET[‘cat’] == -1) {
    status_header(404);
    include( get_404_template() );
    exit;
    }

    If was my site I would just stick that at the top of index.php. But maybe it would be more correct to put in in the themes functions.php file?”

    2. From Elegant Themes – “I am not sure how Yoast works exactly and if it’s adding tags to the head section however you can try this PHP code and place it to the functions.php of your child theme and check the results on Google

    function no_index_archive() {
    if (is_archive()) {
    echo ‘<meta name=”robots” content=”noindex”/>’;
    }
    }
    add_action(‘wp_head’,’no_index_archive’);

    If it won’t help I would suggest to check with Yoast support again and let them know that issue exist in default WordPress theme too.”

    Please let me know what you make of this. Thank you!

    Jackson

    =D

    Thread Starter Jackson

    (@aframeforward)

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    These are volunteer support forum and @’ing people to summon them is rude and counterproductive. I’ve flagged your account temporarily so that will disable any further pings from you. It also means your replies and posts will need a moderator to approve them before others can see what you posted.

    I have nothing to do with Divi and commercial products are not supported in these forums.

    Yoast told me it was a theme (Divi) issue.

    They would know.

    Divi (Elegant Themes) told me it was a WordPress pagination issue.

    It might be but if Yoast said it’s your theme then Elegant Themes is wrong. Lose that theme and see if in a weeks time the Google problem exists.

    • This reply was modified 4 years, 2 months ago by Jan Dembowski.
    Thread Starter Jackson

    (@aframeforward)

    Wow, never expected that kind of response, and most certainly wasn’t trying to be rude by any means.

    As I mentioned above, we did test without the theme and those odd pages are still there. Everyone agreed (Divi, Yoast, Google Webmasters Forum) after that it was indeed a WordPress issue so I was just trying to follow up on that.

    I didn’t get a response to my follow ups so I thought maybe it just got lost in the busy shuffle of everyones lives. No big deal. Never realized tagging someone that you were responding to in a thread could be considered a bad thing. I just thought it meant that you were engaging in a conversation with that person.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Hi there, sorry for the misunderstanding. Text lacks vocal inflection, so sometimes we misunderstand context.

    I’ve removed the flag from your account, but please do avoid at-mentioning people unless absolutely necessary, and please never post duplicate topics.

    At the moment, I’d say you just aren’t getting a response because no one is looking here who knows the answer. WordPress is both built and supported entirely by volunteers, and sometimes we just don’t have the knowledge or time to help.

    To be honest, the path you’ve taken sounds like exactly what I would have done: Contact Yoast -> contact Divi -> contact Google -> shrug, so I think you’re on the right path. But, just like you I’m at “shrug” too and this isn’t something in my wheelhouse of knowledge.

    Someone else will be along with a better answer, I’m sure. 🙂

    Thread Starter Jackson

    (@aframeforward)

    Thanks for your thoughtfulness and time James. I appreciate it!

    I won’t tag anyone ever again now knowing how bad it is. Again, my apologies as I just thought that was how you responded to people on here, as it shows the @ tag handle right next to users name. Figured it was like Instagram, Facebook, Youtube, Twitter, Google, etc.

    Are you referring to my other post today asking about the negative category pages? If so, I was trying to make a more simplified and different post that could make it easier for people to provide insight, as my original post was much more complex and involved many more variables. Also now knowing that it was indeed a WordPress issue I thought that would be helpful. And because no one was responding I figured my original post must not have been effectively worded and was only creating confusion with the stern response from the moderator, and then her not responding to me after that. I thought that thread was dead as a result of how it, and I, was treated.

    I understand the etiquette/expectations here now so thanks for clarifying.

    And yeah, I’m hoping someone can provide some insight as to why those pages are being created, and/or how I can eliminate them from being created, or at least how I keep them from showing up in search results. It’s so strange to me that no one knows how the pages are created or why. Truly baffling. Fingers crossed though and thanks again James! =D

    • This reply was modified 4 years, 2 months ago by Jackson.
    Thread Starter Jackson

    (@aframeforward)

    Also James, I just noticed it was my post today you must have been referring to as it seems to have been removed. Can we just take this one down and put that one back up?

    It’s much much clearer and doesn’t have a negative vibe to it. 😉

    If that’s possible, that would be great.

    If not, can I edit this one to put emphasis on the fact that these are a “Negative” category pages that are being created and show like: https://www.aframeforward.com/?cat=-1

    This part is the most important piece to solving it I’m guessing: /?cat=-1

    Somehow that was removed from my original post here I just now noticed, and is an absolutely crucial piece of information for understanding what’s going on here.

    Thanks so much!

    =D

    Thread Starter Jackson

    (@aframeforward)

    Hmmm, anyone have any ideas how I could best find some help with this?

    Other places I could be reaching out to about these /?cat=-1 pages ?

    A million thank-yous in advance!

    =D

    I too face the same issue, any quick fix? Or need to wait till WordPress fixes it…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Category Pages coming up in Google search results instead of the actual post.’ is closed to new replies.