Calculate Food Cost

SEO Content & Keyword Optimizer

Word Count 0
Keyword Usage 0
Density 0%
Readability

SEO Analysis Report:

function runSeoAnalysis() { var content = document.getElementById('seo-content-body').value; var keyword = document.getElementById('seo-target-key').value.trim(); var output = document.getElementById('seo-output-panel'); if (!content || content.trim().length === 0) { alert('Please enter some content to analyze.'); return; } var wordArr = content.trim().split(/\s+/).filter(function(w){ return w.length > 0; }); var wordCount = wordArr.length; var keyMatchCount = 0; var density = 0; if (keyword.length > 0) { var cleanKey = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); var regex = new RegExp('\\b' + cleanKey + '\\b', 'gi'); var matches = content.match(regex); keyMatchCount = matches ? matches.length : 0; density = ((keyMatchCount / wordCount) * 100).toFixed(2); } document.getElementById('stat-words').innerText = wordCount; document.getElementById('stat-count').innerText = keyMatchCount; document.getElementById('stat-density').innerText = density + '%'; var readingLevel = 'Standard'; if(wordCount > 1000) readingLevel = 'Advanced'; if(wordCount < 300) readingLevel = 'Simple'; document.getElementById('stat-read').innerText = readingLevel; var feedbackHtml = '
    '; if (wordCount < 300) { feedbackHtml += '
  • Word Count: Thin content detected. SEO best practices suggest at least 600-1000 words for better ranking potential.
  • '; } else if (wordCount > 2000) { feedbackHtml += '
  • Word Count: Comprehensive content detected. This has great potential for "Pillar Page" ranking.
  • '; } else { feedbackHtml += '
  • Word Count: Good length for a standard blog post.
  • '; } if (keyword.length > 0) { if (density < 0.5) { feedbackHtml += '
  • Keyword Density: Very low. Consider adding your target keyword naturally in headings and the first paragraph.
  • '; } else if (density > 2.5) { feedbackHtml += '
  • Keyword Density: Warning: High density! Risk of keyword stuffing. Aim for 1.0% to 2.0%.
  • '; } else { feedbackHtml += '
  • Keyword Density: Excellent optimization. Your keyword frequency is natural and SEO-friendly.
  • '; } } else { feedbackHtml += '
  • Enter a Target Keyword to analyze density and placement metrics.
  • '; } feedbackHtml += '
'; document.getElementById('seo-feedback-list').innerHTML = feedbackHtml; output.style.display = 'block'; }

Leave a Comment