惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
T
Threatpost
C
CERT Recently Published Vulnerability Notes
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
Project Zero
Project Zero
H
Heimdal Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
Google Online Security Blog
Google Online Security Blog
W
WeLiveSecurity
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Schneier on Security
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
N
News | PayPal Newsroom
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
S
Securelist
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
NISL@THU
NISL@THU
N
News and Events Feed by Topic
S
Security Affairs
The Last Watchdog
The Last Watchdog
T
Tor Project blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
C
Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security

Pressable

Pressable Achieves Secure Hosting Alliance Certification | Pressable How Pressable MCP Is Changing The Game For WordPress Agencies: A Live Breakdown With Matt Medeiros And Phill Clapham | Pressable April Product Update: Navigation, Organization, And Efficiency | Pressable White-Label WordPress Hosting For Profitable Agencies | Pressable A Guide To Client Onboarding For WordPress Agencies| Pressable WordPress Plugin Management for Agencies WordPress Maintenance Contracts For Agencies: A Complete Guide | Pressable 6 Essential SOPs For WordPress Agencies | Pressable Pressable MCP: Control Your WordPress Hosting With AI. | Pressable How Much Does WordPress Hosting Cost? WordPress Performance Budgets: Setting And Monitoring Goals | Pressable WordPress Automation With No Code Automation Tools | Pressable Implement Single Sign-On (SSO) In WordPress | Pressable How To Build A Real Estate Site On WordPress | Pressable Headless WordPress Showdown: Next.js Vs Gatsby | Pressable How To Automate White-Label WordPress Hosting With WHMCS | Pressable Developer Toolkit Update: Automation & UI Enhancements | Pressable How To Build A DXP Platform With WordPress How To Boost WordPress Agency Client Retention: 4 Strategies White Label WordPress Admin For Agency Clients Performance Testing For WordPress Agency Client Sites Performance Testing For WordPress: A Framework For Agency Client Sites How To Upload A Video To WordPress | Pressable How To Mitigate The Impact Of AI Scraper Bots On WordPress Sites WooCommerce ERP Integration: Automate Your Back Office WordPress Personalization: How To Display Tailored Content To Visitors | Pressable WooCommerce Conversion Rate Optimization: A Data-Driven Approach How To Price Your Online Course: WordPress Monetization Guide 7 Ecommerce KPIs You Should Be Measuring (and How to Optimize Them) WooCommerce Vs. BigCommerce: Which Is Best For Your Business Needs? | Pressable WooCommerce Performance Troubleshooting: Diagnosing Speed Issues Step-by-Step | Pressable AI Content Moderation Tools for WordPress: Fighting Back Against AI Spam WordPress Vs. Craft CMS: Which Is Right For Your Business Site? | Pressable Questions To Ask Before Migrating From Shopify To WooCommerce Outgrowing Squarespace? WooCommerce Can Help WordPress Automation: Google Docs To WordPress Workflow WooCommerce Subscription Strategies: How to Build Recurring Revenue for Your Store Is WordPress Easy To Learn? A Beginner’s Guide WooCommerce Database Optimization With Query Monitor | Pressable WPForms Vs Gravity Forms: Which WordPress Plugin Works Best For Growing Businesses? WooCommerce Vs. Shopify: Choosing The Right Platform The Best AI Chatbots for WordPress Rank Math Vs Yoast: Best WordPress SEO Plugin? 5 Ways AI For Ecommerce Boosts WooCommerce Sales | Pressable WordPress Cookie Consent: What Site Owners Need To Know | Pressable How To Optimize Your WooCommerce Store For AI Search | Pressable WordPress Local SEO: A Guide To Local Search For SMBs | Pressable How to Improve Your WordPress Site’s Search Experience WordPress vs. Substack: Find the Best Platform for Your Newsletter WordPress vs. Ghost: Comparing Open-Source Blog and Newsletter Solutions A Comprehensive Migration SEO Checklist For WordPress Drupal vs. WordPress: Comparing Open Source Content Management Systems How To Add Enterprise-Level Search Capabilities To WordPress Sites What Are WordPress Nonces And How To Use Them | Pressable How To Customize WordPress Without Breaking Your Theme | Pressable WooCommerce vs. Magento (Adobe Commerce): Which is Better for Your Online Store? Prepare Your WooCommerce Store For A High-Traffic Product Drop Tips On Building A Successful WordPress Sales Funnel | Pressable Best WordPress Integrations For Workflow Automation | Pressable WooCommerce Vs. Wix: WooCommerce Explained For Wix Users | Pressable How To Choose WordPress Lead Generation Plugins | Pressable GA4 For WordPress: Understanding Your Data | Pressable WordPress Accessibility for Visually Impaired Users WordPress Information Architecture For Businesses | Pressable How To Use WordPress As A Headless CMS | Pressable How To Use Composer For Modern WordPress Development | Pressable WordPress GitHub Workflows: Version Control Best Practices How To Evaluate A WordPress Plugin Before Installing It | Pressable Billing Clients For WordPress Hosting | Pressable Advanced WooCommerce Cart Abandonment Strategies | Pressable How To Perform A WordPress Security Audit | Pressable How Managed WordPress Hosting Reduces Ops Workload | Pressable The Ultimate Ecommerce CRO Guide | Pressable How to Set Up a Business Continuity Plan for Your WordPress Website How to Hire the Best WordPress Developer for Your Site Common Mistakes When Choosing A WordPress Host | Pressable Beaver Builder Vs. Elementor: Which Page Builder Is Better Streamlining Website Handoff With Managed WordPress Hosting How WordPress Agencies Build Recurring Revenue | Pressable How To Customize WooCommerce Product Pages | Pressable SEO Tip For Migrating Your WordPress Domain | Pressable When To Switch To Enterprise WordPress Hosting | Pressable WooCommerce PIM Tools For Growing Ecommerce Stores | Pressable Automating WordPress Security: Tips To Prevent Cyberattacks Integrating POS With WooCommerce | Pressable Scale Your WordPress: Automation Tips For Growth, Efficiency, And Reliability | Pressable How To Edit Your WordPress Database Safely | Pressable Boosting Conversions, Not Load Times: Performance-Focused A/B Testing of Landing Pages in WordPress WooCommerce Migration: Avoid Downtime and Data Loss With These Essential Tips How To Improve Core Web Vitals on Your WordPress Site How To Run Successful SEO Experiments On WordPress | Pressable Automated WordPress Website Backups | Pressable Grow Ecommerce Sales With WooCommerce Dynamic Pricing LearnDash vs LifterLMS: Which WordPress LMS is Right for You? What Is High Availability Hosting For WordPress? | Pressable Tips On Managing WooCommerce Traffic Spikes | Pressable What To Do When A WordPress Plugin Breaks Your Site Automating Agency Workflows With WordPress Webhooks How To Automate Tasks In WooCommerce With Action Scheduler Why WordPress Downtime Costs And Uptime Guarantees Matters WordPress Cleanup: How to Uninstall WordPress Plugins Without Breaking Your Site
How To Optimize JavaScript Pages For SEO | Pressable
Kevin MacGillivray · 2021-12-09 · via Pressable

Two people collaborate on coding at a computer, surrounded by a modern office setting.

Ask Your Favorite AI

Copy the link to a markdown format of this article for ChatGPT, Claude, Gemini, or your favorite AI.

Hypertext markup language (HTML) isn’t the only type of code used to develop websites. While all websites contain HTML, many of them contain JavaScript as well. A report by W3Techs found that at least some JavaScript code powers over 97 percent of websites. If you use this programming language for web development purposes, though, you’ll need to optimize your website’s JavaScript pages for search engines.

The Basics of JavaScript

JavaScript is a fluid, client-side programming language that consists of text-based scripts. These scripts allow for interactions between visitors and pages. Visitors can essentially change the content displayed on JavaScript pages.

As a client-side programming language, JavaScript runs in web browsers. Visitors may click or scroll to an interactive element on a page, at which point their web browsers will execute the JavaScript. Visitors’ web browsers will then change the page’s content.

The SEO Hurdles of JavaScript

While helpful in developing interactive pages, JavaScript can pose issues for search engine optimization (SEO). Search engines must render pages before they can rank them. Rendering is a crawling-related process in which search engines attempt to view pages from a visitor’s perspective. With JavaScript, search engines may render pages incorrectly, resulting in lower search rankings.

Pages with only HTML and Cascading Style Sheets (CSS) are easy for search engines to render. Search engines will read the HTML to identify the pages’ content, and they’ll analyze the CSS to determine how the content is presented. If a page contains JavaScript, on the other hand, search engines may overlook some of its content.

Using too much JavaScript on a page – or failing to optimize its JavaScrip – may slow it down. The more JavaScript a page has, the harder web browsers will have to work to load it. Slow-loading pages, of course, often rank lower than fast-loading pages.

Using HTML for links will improve the SEO of your JavaScript pages. Links can be defined with different types of code. You can define them with HTML by using the anchor element, or you can define links with JavaScript by using the onclick event.

The problem with JavaScript-defined links is that search engines may not see them. Google, for instance, says it only crawls HTML-defined links. You can use JavaScript to display links, but you should use HTML to define the links rather than JavaScript. Links featuring the onclick JavaScript event may go unnoticed by Google.

Make JavaScript Files Accessible to Search Engines

You should make all of your site’s JavaScript files search engine accessible. To correctly render a JavaScript page, search engines must be able to access all of its JavaScript code. If the code is placed in an external file and you block search engines from accessing it, they won’t be able to render the page.

Of course, JavaScript doesn’t have to be placed in an external file. Like with CSS, it can be embedded directly in pages. Known as inline JavaScript, it eliminates the need for a separate and external file. As long as search engines can access the page, they’ll be able to access its JavaScript code. However, if you use external JavaScript files, you should use your website’s robots directives to ensure search engines can access them.

Don’t Forget Title and Description SEO Meta Tags

JavaScript pages require many of the same SEO meta tags as HTML and CSS pages. Among the most important SEO meta tags are the title and description. The title SEO meta tag is displayed in web browsers, and search engines typically use it to generate titles for indexed pages. While the description SEO meta tag isn’t displayed in web browsers, search engines may use it to create text snippets or descriptions for indexed pages.

There’s nothing wrong with using JavaScript to define title and description SEO meta tags. According to Google, JavaScript can even be used to change both of these SEO meta tags. The bottom line is that all pages should have a title and description meta SEO meta, including those developed mostly in JavaScript.

Complement Infinite Scrolling With Pagination

A common use for JavaScript is to create infinite scrolling. Also known as endless scrolling, it’s an interactive feature that dynamically loads new content as visitors scroll down the page. Infinite scrolling is commonly used on blog feed pages and visitor comment pages. Rather than creating multiple pages of blog feeds or visitor comments, you can create a single page with infinite scrolling.

By itself, infinite scrolling is horrible for SEO. Search engines don’t scroll when rendering pages. Therefore, they’ll only see the content that doesn’t require visitors to scroll down. Any content that’s hidden with infinite scrolling won’t affect the page’s search rankings.

You can use pagination in conjunction with infinite scrolling for improved SEO. Pagination is a navigation process that involves separating a single long-form page into multiple short-form pages. Infinite scrolling pages are long-form. You can include pagination links to other, short-form pages that feature the hidden content on these pages.

Optimize With Minification

Minification can improve your JavaScript pages’ SEO. Minifying JavaScript creates cleaner and more concise scripts by stripping away pointless characters. Letters, spaces, and special characters that don’t serve any purpose will be removed. With fewer total characters, the scripts will load faster. They’ll also be easier for search engines to process.

You can minify JavaScript manually by going through each script and removing unnecessary characters. Alternatively, you can minify JavaScript automatically by using a tool. Fast Velocity Minify is a WordPress plugin that offers minification for JavaScript as well as CSS. It will minify both types of code on your website, assuming your site runs WordPress. And there’s a JavaScript minification tool at jscompress.com that works for all website platforms.

Some Final Thoughts

JavaScript pages can still rank on the first page, but only if you optimize them. Search engines may not render them correctly otherwise. JavaScript SEO consists of using HTML for links, making JavaScript files search engine-accessible, including SEO meta tags on pages, using pagination with infinite scrolling and minification. For more SEO tips, take a look at the following blog articles:

Can iFrames Harm Your WordPress Website’s SEO?

How to Use Keyword Mapping to Improve SEO

Website Hosting and SEO: What’s the Connection (and Why It’s Important)

Pro Tips for Getting the Most Out of Yoast

How to Create Custom Meta Tags for a WordPress Website

Kevin MacGillivray

Kevin MacGillivray is the Chief Marketing Officer at Pressable, where he’s focused on helping more creators build fast, secure, and successful WordPress sites. He’s driven to grow Pressable’s impact and make it the go-to choice for more businesses. Kevin enjoys making technology feel simple, useful, and inspiring through clear storytelling, creative experiments, and building new ways for the community to connect and thrive. Kevin lives in Victoria, British Columbia, where you’ll often find him swimming in the ocean, exploring local trails with his dog, Minerva, or embracing the West Coast’s vibrant lifestyle and easy rhythm.