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

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.


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


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

Filter 'script_loader_src', you get the source URL as first argument. Then run remove_query_arg() on this URL and return the shortened version. Sample code: add_filter( 'script_loader_src', 'remove_script_version_parameter' ); function remove_script_version_parameter( $src ) { return remove_query_arg( 'ver', $src ); }


3

This is a good question, a year back or so, even I was facing similar problems with a website at work. We wanted to track not only campaign and ads on conversions, but also which keywords are leading to higher conversions. Here's what we finally did. Changed the Destination URL in all the ads to include the {keyword} parameter On the landing pages of my ads,...


3

To be clear, the Rich Snippets tool is purely for testing what the formatting/markup of your content is already. It does nothing on its own. Most of the markup that the tool is looking for is usually baked into a theme. WordPress helps this along a little bit by incorporating parts of the hAtom format into the body_class(), post_class(), and [possibly] ...


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


2

I looked at the source code of the site and found this: <meta name="robots" content="noodp,noydir,noarchive,nosnippet"/> Apparently noarchive tells Google to not cache the page. Check out Google Webmaster Tools documentation/guidelines for "Meta tags" for more info on what each value does. PS: If you are unaware, nosnippet should also be removed as ...


2

I use this function to register and enqueue the various scripts my theme uses: function cosmos_enqueue_scripts() { // Load jquery from Google CDN (protocol relative) with local fallback when not available if ( false === ( $url = get_transient('jquery_url') ) ) { // Check if Google CDN is working $url = ( is_ssl() ? 'https:' : 'http:' ) . '//ajax....


2

Scripts don't get printed at the wp_enqueue_scripts hook, but rather at the wp_print_scripts hook. That said: don't echo/print scripts, period. Instead, enqueue them properly. Caveat: This method is Plugin territory, and should not be included as Theme code in a publicly distributed Theme. You deregister jQuery, but the step you're missing is registering ...


2

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


2

Probably Wordpress Ad-Manager plugin will help you. Pay attention that the plugin is not free, but it provides information that you need and makes even more.


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

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

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

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

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


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/


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