0
0
SEO Fundamentalsknowledge~10 mins

Dynamic sitemap generation in SEO Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the sitemap URL in robots.txt.

SEO Fundamentals
Sitemap: [1]
Drag options to blanks, or click blank then click option'
Aindex.html
Bhttps://example.com/sitemap.xml
C/robots.txt
Dhttps://example.com/contact
Attempts:
3 left
💡 Hint
Common Mistakes
Using a page URL instead of the sitemap URL.
Not including the full URL with protocol.
2fill in blank
medium

Complete the code to generate sitemap entries dynamically for each page URL.

SEO Fundamentals
<url><loc>[1]</loc></url>
Drag options to blanks, or click blank then click option'
Apage.url
Bpage.title
Cpage.date
Dpage.author
Attempts:
3 left
💡 Hint
Common Mistakes
Using page title or date instead of URL.
Leaving the <loc> tag empty.
3fill in blank
hard

Fix the error in the sitemap generation loop to correctly iterate over pages.

SEO Fundamentals
for [1] in pages:
    print(f"<url><loc>{page.url}</loc></url>")
Drag options to blanks, or click blank then click option'
Apages
Burl
Cpage
Ditem
Attempts:
3 left
💡 Hint
Common Mistakes
Using the list name as the loop variable.
Using unrelated variable names.
4fill in blank
hard

Fill both blanks to create a sitemap entry with last modification date.

SEO Fundamentals
<url><loc>[1]</loc><lastmod>[2]</lastmod></url>
Drag options to blanks, or click blank then click option'
Apage.url
Bpage.last_modified
Cpage.date
Dpage.title
Attempts:
3 left
💡 Hint
Common Mistakes
Using page title instead of URL.
Using creation date instead of last modified date.
5fill in blank
hard

Fill all three blanks to generate a sitemap dictionary with URL and priority.

SEO Fundamentals
sitemap_entry = { [1]: [2], 'priority': [3] }
Drag options to blanks, or click blank then click option'
A'loc'
B'https://example.com/page1'
C'0.8'
D'daily'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'daily' as priority instead of a number.
Using URL as a key instead of 'loc'.