Connect with us

SEO

6 JavaScript Optimization Tips From Google

Published

on

In a new video from Google, Developer Advocate Alan Kent shares six ways to optimize JavaScript to improve the performance of your website.

Kent identifies common performance problems caused by JavaScript and goes over steps you can take to fix them.

1. Avoid JavaScript File Proliferation

Avoid proliferation in the number of JavaScript files on your site.

The number of JavaScript files could become excessive if you’re not careful, especially if each UI component is in a separate file.

Reducing the number of JavaScript files a browser has to download can improve website performance.

How To Detect

The Opportunity section of the PageSpeed Insights report lists recommendations specific to your site.

Look for the recommendation to keep request counts low and transfer sizes small.

Click on the recommendation for a summary of the number and sizes of resource types requested including JavaScript files.

How To Fix

You can fix this problem in a number of different ways. One option Google recommends is to combine smaller files together to have a single, larger file to download.

Another fix is to support HTTP2 on your site, as it can improve performance without joining files.

2. Avoid Excessive DNS Lookups

Avoid an excessive number of DNS lookups for the reference JavaScript files, as this can slow down a user’s first visit to your site.

How To Detect

PageSpeed Insights can show you a list of domain names used in URLs in sections such as reduce JavaScript execution time.

The network tab in Chrome Developer Tools is another way to see all the domain names referenced.

How To Fix

To reduce the number of DNS lookups, Google suggests you consider hosting a copy of externally referenced JavaScript files on your own site.

3. Eliminate Inefficient JavaScript

Reduce or eliminate inefficient JavaScript, as it can slow down webpages and lead to poor user experiences.

How To Detect

Look for the following opportunities in Google’s PageSpeed Insights report:

  • Reduce JavaScript execution time: This reports scripts where a large amount of CPU time was spent parsing or executing JavaScript code.
  • Eliminate render blocking resources: This includes JavaScript that may be executed before the page can rendered, making the user wait longer to see any content.
  • Document.write: If misused this can cause significant performance issues on a page as it blocks other operations from occurring.
  • Does not use passive listeners: A passive listener is a hint to the browser that JavaScript code will not call a function that prevents scrolling, allowing the browser to scroll the page even while the JavaScript is still executing.

How To Fix

Eliminating inefficient JavaScript is larger topic that goes beyond the scope of Google’s video.

The solutions generally involve writing the JavaScript code differently. Techniques include profiling existing code, and writing your own scaled down versions of more powerful components.

4. Eliminate Unused JavaScript

Unused JavaScript is also inefficient, but Google says this problem is common enough to call it out on its own.

Reusing code across sites can lead to the inclusion of JavaScript that’s not needed.

JavaScript that is never called upon still needs to be downloaded and parsed by the web browser, which is a waste of resources.

How To Detect

Look for the following opportunities in Google’s PageSpeed Insights report:

  • Reduce unused JavaScript: This shows you JavaScript that was not executed as part of loading a page.
  • Avoid enormous network payloads: This identifies areas for improvement by calling out large library downloads.
  • Minimize main-thread work: Includes time spent parsing, compiling, and executing JavaScript.

How To Fix

Google recommends a technique called tree-shaking that can be used to identify JavaScript that is never called, which is safe to delete.

5. Compress JavaScript Files

Make sure your JavaScript files are compressed when downloaded. While the web browser has to spend more CPU time to decompress the file contents, Google says compression is an overall win.

How To Detect

The PageSpeed Insights report has a section highlighting JavaScript files that may benefit from being compressed.

Clicking Enable text compression will show you which files are recommended to be compressed.

How To Fix

Most web browsers or content management systems have built-in support to compress downloads if properly configured.

6. Set Appropriate Cache Durations For JavaScript Code

Check that your JavaScript files are returned with appropriate cache expiry time headers.

This helps browsers avoid the overhead of checking if JavaScript files in its cache are out of date, which improves performance.

How To Detect

In the Networking tab of Chrome Developer Tools you can check the HTTP response headers for JavaScript files that are downloaded. Look for headers such as Cache Control.

In PageSpeed Insights look for the opportunity titled Serve static assets with an efficient cache policy. Clicking on it will show you a list of resources, including JavaScript files, that may benefit from appropriately set cache headers.

How to Fix

A way to enhance the caching of commonly used JavaScript files is to reference files from a shared public location.

If a user visits sites that reuse the same JavaScript file, the browser can use the previously downloaded copy of the file, which will improve performance.

For more detail on any of the above recommendations for optimizing JavaScript, see Google’s full video below:


Featured Image: Visual Generation/Shutterstock

!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=’2.0′;
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,’script’,
‘https://connect.facebook.net/en_US/fbevents.js’);

if( typeof sopp !== “undefined” && sopp === ‘yes’ ){
fbq(‘dataProcessingOptions’, [‘LDU’], 1, 1000);
}else{
fbq(‘dataProcessingOptions’, []);
}

fbq(‘init’, ‘1321385257908563’);

fbq(‘track’, ‘PageView’);

fbq(‘trackSingle’, ‘1321385257908563’, ‘ViewContent’, {
content_name: ‘6-javascript-optimization-tips-from-google’,
content_category: ‘news web-development’
});

Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address

SEO

Google Discusses Fixing 404 Errors From Inbound Links

Published

on

By

Google Discusses Fixing 404 Errors From Inbound Links

Google’s John Mueller responded to a thread in Reddit about finding and fixing inbound broken links, offering a nuanced insight that some broken links are worth finding and fixing and others are not.

Reddit Question About Inbound Broken Links

Someone asked on Reddit if there’s a way to find broken links for free.

This is the question:

“Is it possible to locate broken links in a similar manner to identifying expired domain names?”

The person asking the question clarified if this was a question about an inbound broken link from an external site.

John Mueller Explains How To Find 404 Errors To Fix

John Mueller responded:

“If you want to see which links to your website are broken & “relevant”, you can look at the analytics of your 404 page and check the referrers there, filtering out your domain.

This brings up those which actually get traffic, which is probably a good proxy.

If you have access to your server logs, you could get it in a bit more detail + see which ones search engine bots crawl.

It’s a bit of technical work, but no external tools needed, and likely a better estimation of what’s useful to fix/redirect.”

In his response, John Mueller answers the question on how to find 404 responses caused by broken inbound links and identify what’s “useful to fix” or to “redirect.”

Mueller Advises On When Not To “Fix” 404 Pages

John Mueller next offered advice on when it doesn’t make sense to not fix a 404 page.

Mueller explained:

“Keep in mind that you don’t have to fix 404 pages, having things go away is normal & fine.

The SEO ‘value’ of bringing a 404 back is probably less than the work you put into it.”

Some 404s Should Be Fixed And Some Don’t Need Fixing

John Mueller said that there are situations where a 404 error generated from an inbound link is easy to fix and suggested ways to find those errors and fix them.

Mueller also said that there are some cases where it’s basically a waste of time.

What wasn’t mentioned was what the difference was between the two and this may have caused some confusion.

Inbound Broken Links To Existing Webpages

There are times when another sites links into your site but uses the wrong URL. Traffic from the broken link on the outside site will generate a 404 response code on your site.

These kinds of links are easy to find and useful to fix.

There are other situations when an outside site will link to the correct webpage but the webpage URL changed and the 301 redirect is missing.

Those kinds of inbound broken links are also easy to find and useful to fix. If in doubt, read our guide on when to redirect URLs.

In both of those cases the inbound broken links to the existing webpages will generate a 404 response and this will show up in server logs, Google Search Console and in plugins like the Redirection WordPress plugin.

If the site is on WordPress and it’s using the Redirection plugin, identifying the problem is easy because the Redirection plugin offers a report of all 404 responses with all the necessary information for diagnosing and fixing the problem.

In the case where the Redirection plugin isn’t used one can also hand code an .htaccess rule for handling the redirect.

Lastly, one can contact the other website that’s generating the broken link and ask them to fix it. There’s always a small chance that the other site might decide to remove the link altogether. So it might be easier and faster to just fix it on your side.

Whichever approach is taken to fix the external inbound broken link, finding and fixing these issues is relatively simple.

Inbound Broken Links To Removed Pages

There are other situations where an old webpage was removed for a legitimate reason, like an event passed or a service is no longer offered.

In that case it makes sense to just show a 404 response code because that’s one of the reasons why a 404 response should be shown. It’s not a bad thing to show a 404 response.

Some people might want to get some value from the inbound link and create a new webpage to stand in for the missing page.

But that might not be useful because the link is for something that is irrelevant and of no use because the reason for the page no longer exists.

Even if you create a new reason, it’s possible that some of that link equity might flow to the page but it’s useless because the topic of that inbound link is totally irrelevant to anyting but the expired reason.

Redirecting the missing page to the home page is a strategy that some people use to benefit from the link to a page that no longer exists. But Google treats those links as Soft 404s, which then passes no benefit.

These are the cases that John Mueller was probably referring to when he said:

“…you don’t have to fix 404 pages, having things go away is normal & fine.

The SEO ‘value’ of bringing a 404 back is probably less than the work you put into it.”

Mueller is right, there are some pages that should be gone and totally removed from a website and the proper server response for those pages should be a 404 error response.

Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

SEO

Site Quality Is Simpler Than People Think

Published

on

By

Site Quality Is Simpler Than People Think

Google’s John Mueller, Martin Splitt and Gary Illyes discussed site quality in a recent podcast, explaining the different ways of thinking about site quality and at one point saying it’s not rocket science. The discussion suggests that site quality could be simpler than most people know.

Site Quality Is Not Rocket Science

The first point they touched on is to recommend reading site quality documentation, insisting that site quality is not especially difficult to understand.

Gary Illyes said:

“So I would go to a search engine’s documentation.

Most of them have some documentation about how they function and just try to figure out where your content might be failing or where your page might be failing because honestly, okay, this is patronizing, but it’s not rocket science.”

No Tools For Site Quality – What To Do?

Gary acknowledged that there’s no tool for diagnosing site quality, not in the same way there are tools for objectively detecting technical issues.

The traffic metrics that show a downward movement don’t explain why, they just show that something changed.

Gary Illyes:

“I found the up-down metric completely useless because you still have to figure out what’s wrong with it or why people didn’t like it.

And then you’re like, “This is a perfectly good page. I wrote it, I know that it’s perfect.”

And then people, or I don’t know, like 99.7% of people are downvoting it. And you’re like, ‘Why?’”

Martin Splitt

“And I think that’s another thing.

How do I spot, I wrote the page, so clearly it is perfect and helpful and useful and amazing, but then people disagree, as you say.

How do you think about that? What do you do then?

How can I make my content more helpful, better, more useful? I don’t know.

…There’s all these tools that I can just look at and I see that something’s good or something’s bad.

But for quality, how do I go about that?”

Gary Illyes

“What if quality is actually simpler than at least most people think?

…What if it’s about writing the thing that will help people achieve whatever they need to achieve when they come to the page? And that’s it.”

Martin Splitt asked if Gary was talking about reviewing the page from the perspective of the user.

Illyes answered:

“No, we are reframing.”

Reframing generally means to think about the problem differently.

Gary’s example is to reframe the problem as whether the page delivers what it says it’s going to deliver (like helping users achieve X,Y,Z).

Something I see a lot with content is that the topic being targeted (for example, queries about how to catch a trout) isn’t matched by the content (which might actually be about tools for catching trout) which is not what the site visitor wants to achieve.

Quality In Terms Of Adding Value

There are different kinds of things that relate to site and page quality and in the next part of the podcast John Mueller and Gary Illyes discuss the issue about adding something of value.

Adding something of value came up in the context of where the SERPs offer good answers from websites that people not only enjoy but they expect to see those sites as answers for those queries.

You can tell when users expect specific sites for individual search queries when Google Suggests shows the brand name and the keyword.

That’s a clue that probably a lot of people are turning keywords into branded searches, which signals to Google what people want to see.

So, the problem of quality in those situations isn’t about being relevant for a query with the perfect answer.

For these situations, like for competitive queries, it’s not enough to be relevant or have the perfect answer.

John Mueller explains:

“The one thing I sometimes run into when talking with people is that they’ll be like, “Well, I feel I need to make this page.”

And I made this page for users in air quotes…

But then when I look at the search results, it’s like 9,000 other people also made this page.

It’s like, is this really adding value to the Internet?

And that’s sometimes kind of a weird discussion to have.

It’s like, ‘Well, it’s a good page, but who needs it?’

There are so many other versions of this page already, and people are happy with those.”

This is the type of situation where competitive analysis to “reverse engineer” the SERPs  works against the SEO.

It’s stale because using what’s in the SERPs as a template for what to do rank is feeding Google what it already has.

It’s like, as an example, let’s represent the site ranked in Google with a baseline of the number zero.

Let’s imagine everything in the SERPs has a baseline of zero. Less than zero is poor quality. Higher than zero is higher quality.

Zero is not better than zero, it’s just zero.

The SEOs who think they’re reverse engineering Google by copying entities, copying topics, they’re really just achieving an imperfect score of zero.

So, according to Mueller, Google responds with, “it’s a good page, but who needs it?”

What Google is looking for in this situation is not the baseline of what’s already in the SERPs, zero.

According to Mueller, they’re looking for something that’s not the same as the baseline.

So in my analogy, Google is looking for something above the baseline of what is already in the SERPs, a number greater than zero, which is a one.

You can’t add value by feeding Google back what’s already there. And you can’t add value by doing the same thing ten times bigger. It’s still the same thing.

Breaking Into The SERPs By The Side Door

Gary Illyes next discusses a way to break into a tough SERP, saying the way to do it is indirectly.

This is an old strategy but a good one that still works today.

So, rather than bringing a knife to a gunfight, Gary Illyes suggests choosing more realistic battles to compete in.

Gary continued the conversation about competing in tough SERPs.

He said:

“…this also is kind of related to the age-old topic that if you are a new site, then how can you break into your niche?

I think on today’s Internet, like back when I was doing ‘SEO’, it was already hard.

For certain topics or niches, it was absolutely a nightmare, like ….mesothelioma….

That was just impossible to break into. Legal topics, it was impossible to break into.

And I think by now, we have so much content on the Internet that there’s a very large number of topics where it is like 15 years ago or 20 years ago, that mesothelioma topic, where it was impossible to break into.

…I remember Matt Cutts, former head of Web Spam, …he was doing these videos.

And in one of the videos, he said try to offer something unique or your own perspective to the thing that you are writing about.

Then the number of perspective or available perspectives, free perspectives, is probably already gone.

But if you find a niche where people are not talking too much about, then suddenly, it’s much easier to break into.

So basically, this is me saying that you can break into most niches if you know what you are doing and if you are actually trying to help people.”

What Illyes is suggesting as a direction is to “know what you are doing and if you are actually trying to help people.

That’s one of my secrets to staying one step ahead in SEO.

For example, before the reviews update, before Google added Experience to E-A-T, I was telling clients privately to do that for their review pages and I told them to keep it a secret, because I knew I had it dialed in.

I’m not psychic, I was just looking at what Google wants to rank and I figured it out several years before the reviews update that you need to have original photos, you need to have hands-on experience with the reviewed product, etc.

Gary’s right when he advises to look at the problem from the perspective of “trying to help people.”

He next followed up with this idea about choosing which battles to fight.

He said:

“…and I think the other big motivator is, as always, money. People are trying to break into niches that make the most money. I mean, duh, I would do the same thing probably.

But if you write about these topics that most people don’t write about, let’s say just three people wrote about it on the Internet, then maybe you can capture some traffic.

And then if you have many of those, then maybe you can even outdo those high-traffic niches.”

Barriers To Entry

What Gary is talking about is how to get around the barrier to entry, which are the established sites. His suggestion is to stay away from offering what everyone else is offering (which is a quality thing).

Creating content that the bigger sites can’t or don’t know to create is an approach I’ve used with a new site.

Weaknesses can be things that the big site does poorly, like their inability to resonate with a younger or older audience and so on.

Those are examples of offering something different that makes the site stand out from a quality perspective.

Gary is talking about picking the battles that can be won, planting a flag, then moving on to the next hill.

That’s a far better strategies than walking up toe to toe with the bigger opponent.

Analyzing For Quality Issues

It’s a lot easier to analyze a site for technical issues than it is for quality issues.

But a few of the takeaways are:

  • Be aware that the people closest to the content are not always the best judges of content is quality.
  • Read Google’s search documentation (for on-page factors, content, and quality guidelines).
  • Content quality is simpler than it seems. Just think about knowing the topic well and being helpful to people.
  • Being original is about looking at the SERPs for things that you can do differently, not about copying what the competitors are doing.

In my experience, it’s super important to keep an open mind, to not get locked into one way of thinking, especially when it comes to site quality. This will help one keep from getting locked into a point of view that can keep one from seeing the true cause of ranking issues.

Featured Image by Shutterstock/Stone36

Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

SEO

Is Alt Text A Ranking Factor For Google Image Search?

Published

on

By

Is Alt Text A Ranking Factor For Google Image Search?

Alt text is used to help computers read images.

But can alt tags affect your organic search rankings?

Read on to learn whether there is any connection between alt text and improved rankings in Google Image Search results.

The Claim: Alt Text Is A Ranking Factor

What is alt text?

Alt text is an HTML image attribute. It allows you to create an alternative text version of your image if it cannot load or has an accessibility issue.

Because of its importance to Google Image Search, it is considered a ranking factor.

[Ranking Factors 2023] Download the free ebook + cheat sheet 

Alt Text As A Ranking Factor: The Evidence

Google emphasizes how alt text plays a vital role in getting your images recognized by Google Image Search.

You will find a page on image best practices in Google Search Central’s Advanced SEO documentation. In a section called “about alt text,” Google discusses the use of alt text.

“Google uses alt text along with computer vision algorithms and the contents of the page to understand the subject matter of the image. Also, alt text in images is useful as anchor text if you decide to use an image as a link.”

While the company doesn’t specify that alt text will improve your rankings, it warns website owners that improper use can harm your website.

“When writing alt text, focus on creating useful, information-rich content that uses keywords appropriately and is in context of the content of the page.

Avoid filling alt attributes with keywords (also known as keyword stuffing) as it results in a negative user experience and may cause your site to be seen as spam.”

It also offers the following examples of good and bad alt text usage.

Screenshot from Google Search Central, August 2023Google Search Central best practice for images

Google Sites Help documentation indicates that images may come with pre-populated alt text, including keywords for which you may not want to optimize.

“Some images automatically include alt text, so it’s a good idea to check that the alt text is what you want.”

For example, when I download stock photos, a text description of the image is embedded in the file.

Is Alt Text A Ranking Factor For Google Image Search?Screenshot by author, August 2023Is Alt Text A Ranking Factor For Google Image Search?

When uploaded to a content management system (CMS) like WordPress, the text descriptions may need to be moved to the alt text field or modified to remove unnecessary keywords.

Is Alt Text A Ranking Factor For Google Image Search?Screenshot from WordPress, August 2023Is Alt Text A Ranking Factor For Google Image Search?

In Google Search Central’s “Search Engine Optimization Starter Guide,” it offers the following advice about alt tags when using images as links:

“…if you’re using an image as a link, the alt text for that image will be treated similarly to the anchor text of a text link. However, we don’t recommend using too many images for links in your site’s navigation when text links could serve the same purpose.”

In 2020, John Mueller, Google Search Advocate, answered a question about the alt text of a quote image during a Google Webmaster Office Hours. In the answer, he talked about how Google uses it:

“For Search, what happens with the alt attribute is we use that to better understand the images themselves, in particular, for Image Search. So if you didn’t care about Image Search, then from a Search point of view, you don’t really need to worry about alt text.

But if you do want these images to be shown in Image Search, which sometimes it makes sense to show fancy quotes in Image Search as well, then using the alt attribute is a good way to tell us this is on that image and we’ll get extra information from around your page with regard to how we can rank that landing page.”

Moz mentions ranking factors about alt text. Instead of saying that the alt text itself is a ranking factor, Moz advises:

“…alt text offers you another opportunity to include your target keyword. With on-page keyword usage still pulling weight as a search engine ranking factor, it’s in your best interest to create alt text that both describes the image and, if possible, includes a keyword or keyword phrase you’re targeting.”

In 2021, during a Twitter discussion about ALT text having a benefit on SEO, Google Developer Martin Splitt said:

“Yep, alt text is important for SEO too!”

Later in 2021, Mueller noted that alt text is not magic during a conversation about optimization for indexing purposes.

“My understanding was that alt attributes are required for HTML5 validation, so if you can’t use them with your platform, that sounds like a bug. That said, alt text isn’t a magic SEO bullet.”

[Recommended Read] → Ranking Factors: Systems, Signals, and Page Experience

Alt Text As A Ranking Factor: Our Verdict

Is Alt Text A Ranking Factor For Google Image Search?Is Alt Text A Ranking Factor For Google Image Search?

Alt text is a confirmed ranking factor for image search only. You should craft descriptive, non-spammy alt text to help your images appear in Google Image Search results.

Alt text is definitely not a ranking factor in Google Search. Google has clarified that alt text acts like normal page text in overall search. So it’s not useless, but it’s not a separately considered ranking factor in your page content.

That doesn’t mean you should ignore alt text. It’s a helpful accessibility tool for screen readers. When you’re writing alt text, ask yourself what you want someone who can’t see the image to understand about it.


Featured Image: Paulo Bobita/SearchEngineJournal



Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

Trending