Hot answers tagged

7

The pages should not be indexed if there are no direct links to them. Search engines don't guess at URLs, so I am guessing that a large part of your problem here is with your own code-- that is, you are generating links somewhere that the engines can follow. If it were me, I'd create a new post type for this usage and register it with 'public'->false so ...


6

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 plugin so I named it accordingly, but you can ...


5

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='/google_analytics_auto.js'></script></head> I my self also faced with this issue, my main website is ...


5

This isn't really a WordPress specific question. However, I recently wrote a function for this (and blocking other user agents). Perhaps you could use it, or some of it?: function is_a_bot(){ $is_bot = false; $user_agents = array( 'GTmetrix', 'Googlebot', 'Bingbot', 'BingPreview', 'msnbot', 'slurp', 'Ask Jeeves/Teoma', 'Baidu', 'DuckDuckBot', '...


4

Well those are two different things: A redirect means they are not accessible any more at all. noindex just means that search engines ignore it while it is still accessible if you access the URL. So I'd recommend option 1. This is a simple way of doing this that you can improve an. (E.g. this expects to have a static front page set and doesn't handle any ...


4

Check header.php and footer.php; sounds like that link is part of your theme and is pulling that script, possibly from a plugin that is supposed to be included with the theme or in the "must use" plugin folder, which is called mu-plugins in wp-content.


3

I would suggest a shortcode: function gcse_wpse_143459($atts,$content) { return '<gcse:searchbox-only></gcse:searchbox-only>'; } add_shortcode('gcse','gcse_wpse_143459'); Then use [gcse] instead of trying to paste in an oddball html-ish tag.


3

If you're creating the theme yourself, you can always use Schema Microata markup directly in the theme itself. As we can see in the below example, adding extra attributes to your HTML can make it Schema compliant. In this instance, we are using itemscope, itemtype and itemprop: Taken from http://schema.org/docs/gs.html#microdata_how <div itemscope ...


3

This is likely that you are using an SEO tool. Go to the settings for that tool and remove the word "archive" from the archive section of your SEO. If you DON'T have SEO tool, then get one. An example would be Yoast (this is by no means a recommendation, just an example) and in it's settings you'll be able to remove the "archive" from archive titles.


3

This part of the request (URL) %3C?php%20bloginfo('rss2_url');%20?%3E is an attempt to put PHP code in a URL; it's the equivalent of <?php bloginfo('rss2_url'); > It may be that some hacker code in a compromised page is built to take the query parameters of the page and try to execute that code for some purpose. As long as you have: completely ...


3

Adding this code to the top of the index.php file in your theme will return a 403 if the theme directory is accessed directly: if ( ! defined( 'ABSPATH' ) ) { header( 'HTTP/1.0 403 Forbidden' ); die(); } However, you never see that code in any theme's index.php file, because it's unnecessary. I only include it so that this answer has an actual ...


2

A friend of mine (John Eckman) wrote WPGPlus which sets out with the goal to do just that. I know some people have had success with it, others not so much. However, it may be a good place to look at the code and use it as a starting point. Good luck!


2

You should be able to paste the HTML of the Google Docs iframe directly into the page by using the TEXT mode of the edit form (instead of the VISUAL) mode. That mode allows you to enter the HTML directly, while the WYSIWYG editor will either ignore it or treat it as text.


2

You are missing the 'echo' userfullName = <?php $current_user->display_name;?> should be var userfullName = "<?php echo $current_user->display_name;?>" AND notice that I put quotes around that too. BUT!!!! You should really look at using wp_localize_script for declaring javascript variables. Example: add_action('wp_enqueue_scripts'...


2

You should run updatepage() function after loading the google jsapi script. try jquery ready inside updatepage like this: function updatepage(){ // this line added by me jQuery(document).ready(function ($) { // Load the Visualization API and the piechart package. .... .... chart.draw(data, options); } } ...


2

If the fonts are loaded from a plugin, a hook will have to be used to insert them, you can disable the hook, but you'll need to know where it's coming from. Mostly because you'll need the handle of the script. There are quite a few different ways it could be done so I'll try to give an example of one way it may be done, but there's a good chance you'll need ...


2

The question is old. However, there are a lot of people who are facing the same issue in 2018. So, I am giving the the most effective answer. There are different ways to optimize images: Use the right format: Make sure to upload iamges to your WordPress website in JPEG format, rather than PNG. The latter one eats up a lot of space. Resize Images: You can ...


2

First, don't let Google Insights drive you to chase an ROI that might not be there. Maybe for 1M of image data improvement, it is worth looking into - but after awhile that tool will have you minifying 1K css files to save 100 bytes. Second, regarding images - don't just blindly reduce ('compress'...really a misnomer) jpeg images. jpeg is a lossy format ...


2

Where is the fold now? to me, the fold is a little outdated, as it fully depends on the device/monitor size. It may be that JavaScript in the header of your site is blocking the page load. The best way to combat this is to simply load the JavaScript in the footer of the site instead.


2

I know - I hate the fact that Google indexes the site code, and then floods my logs with 404s for old files. You can add something like this to your robots.txt file: User-agent: * Disallow: /wp-content/plugins/ Disallow: /wp-content/themes/ You could probably just have Disallow: /wp-content/ but that would also stop your images in the uploads folder from ...


2

Your website is infected by Malware. Hackers are using your WordPress website for ‘spamvertising.’ This causes an insane traffic spike. Spam emails are sent from your server with links to existing or new pages that are created by the hacker. Spamvertising can vandalize blogs, websites, forums, and comment sections with hyperlinks to get a higher search ...


1

you can use this function i think it works properly. add_filter( 'wp_authenticate_user', 'verify_recaptcha_on_login', 10, 3 ); function verify_recaptcha_on_login($user, $password) { $secretkey = "your secret key"; if (isset($_POST['g-recaptcha-response'])) { $response = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret='.$...


1

Google App Engine is a third party host and dealing with them is really off topic here. That error is a simple permission and/or file error and has nothing to do with WordPress itself. You're beter off asking at Google http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/ or trying https://wordpress.org/plugins/google-app-engine/


1

I wanted to make a comment to mention this but I don't have enough rep yet to do so. I had a problem similar to this and I used a simple plugin as a basis to solve the issue. You might be able to do the same. Checkout disable-google-fonts on GitHub. It disables various google fonts found in Wordpress themes. You could modify this or use snippets of the code ...


1

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 allow ...


1

It seems to be a WP default setting, as many Webmasters have gotten this warning and never edited the robots.txt. Removing all the disallows is the easiest solution, but I assume you want some or all of those directories blocked. Google is only concerned about the .js and .css files, so you could in theory edit the robots.txt to include: User-Agent: ...


1

Jamie, do you already have hosting for your WordPress site? And to be specific, is your WordPress site self-hosted, or are you using WordPress.com? If I understand your question correctly, you will need to point the domain name you purchased to your hosting/server. Depending on where you are hosting your site, you may have access to cPanel, Plesk or some ...


1

Anything to do with using the Google Places API is going to be off-topic here, but the best place to start would be the developer docs. However, how you interact with the API data within WordPress is certainly on-topic. I would suggest a wrapper function that caches the results periodically: /** * Get places data for a post. * * @param int|WP_Post $...


1

It depends on what the template uses to output whatever you're trying to remove. If you look in source at whatever function is outputting what you want to remove, they each have a filter to let you modify output where you can __return_false instead, however, if there's text or markup surrounding those template tags, your only option is to modify the template,...


1

Pings are a mechanism for a fast update. For example if you are using a external feed service you want it to update as fast as possible when new post is up. Search engines do not care about it in this way. Pinging search engine won't typically mean it will bother to index page immediately (if at all). Site maps are a mechanism for methodical update. They ...


Only top voted, non community-wiki answers of a minimum length are eligible