[SEO] How Wordpress load a post withPermalink / Pretty URL?
It is crucial to know how WP loads your URL in terms of SEO Here is how it works Assume that we have a URL like this: http://my_domain/jw萬豪酒店加送多項婚宴優惠/ When Wordpress (v5.4) first load your post, the files are loaded like this: - /index.php, then load - /wp-blog-header.php And wp-blog-header.php called a function called wp(), which leads to the following code: public function main( $query_args = '' ) { $this->init(); $this->parse_request( $query_args ); $this->send_headers(); $this->query_posts(); $this->handle_404(); $this->register_globals(); /** * Fires once the WordPress environment has been set up. * * @since 2.1.0 * * @param WP $this Current WordPress environment instance (passed by reference). */ do_action_ref_array( 'wp', array( &$this ) ); } Now if you add log: public function main( $query_args = '' ) { $this->init(); $this->parse_request( $query_args ); $this->send_headers(); ...