• Resolved san99

    (@san99)


    I have been trying to change url/permalink of the attachment pages in twenty sixteen for days with no success, I have tried many codes which have been shared on this website but nothing seems to be working for me. I am running some photography websites on wp, I want to change the permalink structure and want it to look cute, short and sensible. Here are some of the formats I am trying to achieve. structure 1:

    sitemamdotcom/images/attachment-title(i want to trim the title to three to four words only because long title does not look good).
    Structure 2:

    sitemamedotcom/z/5digits/attachment-title-3words/5digits
    (random 5 digits in both sides not the same, different digits in all attachment)
    structure 3:

    sitenamedotcom/attachment-title-3words/attachment-id/
    I want to show attachment pages as individual posts, the long url/slug making it difficult for me to copy the link and share.

Viewing 16 replies (of 16 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t understand very complex wp terms like crux

    Don’t worry, it’s not that important, “crux” is actually unrelated to WP. It’s just a poor choice of words on my part. A “crux” is simply the most difficult part of a task or process. In my last post I meant getting the schema to appear with the image is the most difficult part of the process.

    Whether multiple alts are a good idea or not depends on how you are presenting these various sizes of images. You can only have one alt attribute for each img tag. If you have 5 img tags, you can have an alt attribute in each one. If all of the images are listed in a srcset attribute belonging to a single img tag, then you can only have one alt attribute.

    As a general rule, if your HTML can be validated by the W3C Validation Service, then it’s generally safe to do what you’re doing. However, W3C does not care about SEO. Validated HTML can still result in bad SEO. OTOH, invalid HTML cannot be good for SEO, you should strive to have code that validates. The validation tool is very particular. You may chose to ignore some of it’s recommendations and it might not affect SEO, but it’s still something to strive for.

    Very few people can really know what’s good for SEO and what’s not. Search sites like Google give us general guidelines, but nothing specific. Specific methods to enhance SEO are determined largely through trial and error. But SEO algorithms are always being adjusted, so what we learned last year may not apply this year.

    Custom templates for attachment pages can be a good way to deal with this, but the schema data still needs to come from somewhere. It wouldn’t be a simple hack, but one good approach would be to add the needed additional schema fields to the image’s attachment details in the media library. Such data can be saved in the attachment’s post meta. The custom template could then grab this data when it is outputting the HTML and include the data as part of the schema structure.

Viewing 16 replies (of 16 total)
  • The topic ‘How to add numeric digits to the attachment page url in wordpress?’ is closed to new replies.