how to hide specific post from google search

Hook into the action wp_head, test if you are on the category archive or a single post with that category, and print the proper meta element: add_action( ‘wp_head’, ‘wpse_91073_noindex’ ); function wpse_91073_noindex() { if ( ( is_singular() && in_category( ‘CATEGORY_SLUG’ ) ) or is_category( ‘CATEGORY_SLUG’ ) ) { print ‘<meta name=”robots” content=”noindex”>’; } } Replace … Read more

Does wordpress insert automatic google analytic?

The reason is you are using HostGator and enable the feature is Google Analytics Integration, by enable this one, HostGator will automatically add this snipped of code into your main website and all of it sub or add-on domain: <script src=”https://wordpress.stackexchange.com/google_analytics_auto.js”></script></head> I my self also faced with this issue, my main website is http://nguyenhuutrong.com and … Read more

Feed 404 Errors

For all those who might hit the same problem, here is the solution: Disable in Yoast the “remove category” option in advanced section. Then install this plugin: https://wordpress.org/plugins/remove-category-url/ ( do use any other plugin as this one works – yes, I tried them all) For some reason the Yoast solution and all other plugins don’t … Read more

Pass custom fields values to Google Maps

Here’s a version that uses wp_localize_script(), as suggested by others. It’s just a little bit cleaner, since you don’t mix your PHP with your JS, and generally a neat way to pass things from the server side to your JavaScript. First, put the following code either in your plugin or your functions.php (I use a … Read more

Make Google index the entire post if it is separated into several pages

The basic problem for a script solution is: rel_canonical does not offer any useful filter. So we have to replace that function: remove_action( ‘wp_head’, ‘rel_canonical’ ); add_action( ‘wp_head’, ‘t5_canonical_subpages’ ); The next problem: $GLOBALS[‘numpages’] is empty before setup_postdata(). We could call that function already here, but it might have side-effects. Here is a solution that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)