จาก Blog ตอนที่แล้ว ผมได้เขียนไปเกี่ยวกับการแก้ปัญหาที่เกิดขึ้นจาก “Google Structured Data testing tools” ใน Theme WordPress นะครับ โดยในตอนนี้ผมมานำเสนอวิธีแก้ปัญหากับ Theme WordPress "DW Minion" ที่ใช้งานบน Blog ของผมครับ ตามขั้นตอน ดังนี้
- ก่อนการแก้ไข เมื่อเข้า Google Web Master พบว่ามี Error เกี่ยวกับตัว Structure Date ดังรูป

- พอเข้าไปดูรายละเอียด พบว่า Structured Data ขาดข้อมูลในส่วนของ "Update" ดังรูป

- มาถึงจุดนี้ลองกลับไปแก้ปัญหาใน Blog ตอนที่แล้ว พบว่าไม่มี Code ส่วนไหนที่มี Pattern ตรงกันครับ
- เมื่อ Code มี Pattern ไม่ตรงกัน แต่เรารู้ว่า Field "updated" คือ เวลาที่ Update Content ล่าสุดครับ ถึงตอนนี้ได้เวลาใน Tools ช่วยครับ โดยผมใช้เจ้า Inspect Element (Firefox) มาช่วย ซึ่งได้ผลลัพธ์ ดังรูปครับ

- นำผลลัพธ์ที่ได้ ไปหา Code ที่มี Pattern คล้ายๆกันครับ (ไม่ต้องไปไล่เปิดทุกไฟล์นะครับ ผมใช้ Tools ชื่อ grepwin หาครับ และใช้ความรู้โครงสร้าง Theme นิดหน่อย) โดยพบว่าไฟล์ที่ต้องแก้ไข คือ ไฟล์ template-tags.php ซึ่งอยู่ใน
path .../wp-content/themes/dw-minion/inc
และเพิ่ม Field update ลงไปในส่วนของ Tag Span ดังรูป

- จากนั้นรอให้ Google Crawler เข้ามาเก็บข้อมูล โดยพบว่า Error ลดลงครับ

- ลอง Test อีกที่ด้วย Google Structured Data testing tools พบว่าระบบสามารถดึงข้อมูลได้นะครับ

สุดท้ายนี้ SEO ที่ดี นอกจากการ Promote แล้ว ต้องมีการปรับแก้ไข Code ให้ Support ด้วยนะครับ
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.