Hi Joe,
We use a custom post type to create the FAQs and what you’re seeing at the location/URL you referenced is the archive for all posts in that post type.
If you really wanted to completely remove the archive, you would have to alter where we register the post type in the “CustomPostTypes.class.php” file (in the “includes” folder) and either remove the “has_archive” attribute or set it to “false”.
This change would, however, be overwritten if you were to update the plugin.
What I would suggest, instead, is that you just set it so the archive pages are not indexed. You can do this either directly via your robots.txt file or via a plugin that alters the robots file for you. WP Beginner has a good tutorial about this, here: https://www.wpbeginner.com/wp-tutorials/how-to-optimize-your-wordpress-robots-txt-for-seo/
-
This reply was modified 3 years, 11 months ago by
jaysupport.
-
This reply was modified 3 years, 11 months ago by
jaysupport.
-
This reply was modified 3 years, 11 months ago by
jaysupport.
Thread Starter
joeco
(@joeco)
Hello,
Thanks for responding! I set the has_archive to “false” as directed. The /ufaq page still exists and the sub pages for each faq under the /ufaq/ post type still exist and pop in internal WP searches. Neither of which is desirable in our SEO scheme.
What needs to happen is to either:
remove the ufaq generated pages & make sure they’re not populated
or
noindex,nofollow these pages & make sure they don’t pop up in internal search.
How can I make this happen?
Thanks again!
You can set them to not be indexed via the robots file, as I suggested in my previous reply and as explained in the linked WP Beginner article.
As for the search on your site, the only way to stop that would be to remove the archives completely, as I suggested. If you’re still seeing them after removing the has_archive attribute, then it’s either just caching or you need to flush your permalinks (i.e. go to “Settings” -> “Permalinks” in the WordPress sidebar and hit “Save Changes”).
Thread Starter
joeco
(@joeco)
Hello Jaysupport,
I applied your instructions. The /ufaq issue appears to be resolved.
Thank you!
Thread Starter
joeco
(@joeco)
Hi again,
fyi — This script solved the ufaq’s popping up in WP search results:
add_action( 'init', 'update_my_custom_type', 99 );
function update_my_custom_type() {
global $wp_post_types;
if ( post_type_exists( 'ufaq' ) ) {
// exclude from search results
$wp_post_types['ufaq']->exclude_from_search = true;
}
}