0

I have a WordPress website with thousands of registered users. For each user a profile page is created. Most of these pages are low quality because most users do not fill their profile with information, therefore, I don't want search engines indexing these pages. However, some Author pages are high quality.

At the moment I'm using WordPress SEO plugin to add a noindex metatag in Author pages, I know I could also block the /Author/ directory in robots.txt. But the thing is, I want to allow crawlers to crawl those specific high quality Author pages.

Any ideas?

1 Answer 1

3

I would normally ask a couple clarifying questions but I don't have the reputation to do it so let's see if I can give you a workable solution. I don't know what you consider to be high quality but if it is certain fields being complete, you could do an if/else statement around those fields being set. Let's say you have fields created in the user profile area that these users fill out for job and title (and for the sake of the example, if these two fields are filled out, it is a good profile). You might access those fields by using:

$job = get_the_author_meta( 'job' );
$title = get_the_author_meta( 'title' );

if( empty( $job ) && empty( $title ) {
    $meta = '<META NAME="ROBOTS" CONTENT="NOINDEX">';
    echo $meta;
}

OR you could wrap that whole thing in a function in your functions.php and then call the function in your header.

That would set it up so that if both of those fields were empty, the meta tag would be added. If either were filled out (or both), it wouldn't be. You may need to modify the logic to fit your needs but the idea is:

  1. Decide what constitutes high quality
  2. Retrieve that data
  3. Compose a rule to add the meta tag in if rules are not met.
  4. Echo result
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.