What is client-side code? What is server-side code? What code can Google and OpenAI actually see when crawling the website?
Server-Side Code: The server-side code is the HTML code as built by the web server before the web page is sent to the visitor’s browser. Usually, the server-side code is generated by a content management system like WordPress. Googlebot will have no trouble seeing this code because it is sent directly from the server to the robot. This is the only code that OpenAI and other generative AI bots will currently be able to see on your website.
Client-Side Code: In contrast, client-side code is updated within the visitor’s web browser. As JavaScript code fires in response to various events, the browser will update the website HTML to show new content or features. Google is only able to execute the load event and will not trigger click or scroll events. AI bots currently do not execute JavaScript, so they would not see any code loaded via JavaScript.
You want to make sure that your website’s content is present in the code that Google and other bots are able to see when crawling the website.
Learn more about SEO considerations when using JavaScript.